多个子域名支持与App链接 [英] Multiple subdomain support with App Links

查看:345
本文介绍了多个子域名支持与App链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读文档支持Android和我的应用程序支持使用子的作品,但有太多的子域,它们是动态建立的网站应用程序的链接。我在想,如果有支持许多子域,而无需specifiy他们都在意向过滤器标签的方式。

下面是链接从谷歌的例子: HTTP: //developer.android.com/training/app-links/index.html#request-verify
这个例子是在支撑应用程序链接为多个子域的位置。

我想到了一个正则表达式的工作,但显然定义主机时所不支持的。我不想一一列举,因为这将意味着有推新版本与创建的每个新的子域

 <活动...>
    &所述;意图滤光器>
        <作用机器人:名字=android.intent.action.VIEW/>
        <类机器人:名字=android.intent.category.DEFAULT/>
        <类机器人:名字=android.intent.category.BROWSABLE/>
        <数据机器人:计划=HTTPS/>
        <数据机器人:主机= />中* example.org。
        <数据机器人:pathPattern =/.*/>
    &所述; /意图滤光器>
< /活性GT;

我想preFER不使用第三方lib或服务。但是,对你的工作有什么建议将pciated了解如何使这项工作AP $ P $。


解决方案

  

该网站我的应用程序支持使用子的作品,但有太多的子域,它们是动态建立


欢迎您来实现这些的一些子集(例如,被当时已知的那些您构建的应用程序)应用程序的链接。你可能甚至考虑做饭了摇篮插件,可以生成从某处域列表中相应的清单元素。

不过,域在安装时检查,并没有任何手段来增加新的领域,除了由船应用程序的新版本使用新的清单。


  

我想知道是否有支持许多子域,而无需specifiy他们都在意向过滤器标签的方式。


没有,对不起。 Android的检查域和检索在安装时的JSON文件。


  

我想到了一个正则表达式的工作,但显然定义主机时不支持的


您不能从一个正则表达式下载JSON。


  

我不想一一列举,因为这将意味着有推新版本与创建的每个新的子域


然后要么支持一些常见的子集,或者不支持的应用链接现在。可以想象,如果有些不太恕我直言,谷歌将在未来提供更多灵活的选择这一点。

I've been reading the docs for supporting app links for android and the website my app supports works with subdomains but there's too many subdomains and they are built dynamically. I was wondering if there is a way to support many subdomains without having to specifiy them all in the intent-filter tag.

Here is the link to the example from google: http://developer.android.com/training/app-links/index.html#request-verify The example is in the Supporting app linking for multiple subdomains location.

I thought a regex would work but apparently that's not supported when defining the host. I don't want to list all of them since that would mean having to push a new release with every new subdomain created

<activity ...>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:host=".*.example.org" />
        <data android:pathPattern="/.*" />
    </intent-filter>
</activity>

I would prefer not to use a third party lib or service.. But any suggestions that work for you would be appreciated to understand how to make this work.

解决方案

the website my app supports works with subdomains but there's too many subdomains and they are built dynamically

You are welcome to implement app links for some subset of those (e.g., the ones that are known at the time you build the app). You might even consider cooking up a Gradle plugin that can generate the appropriate manifest elements from a list of domains somewhere.

However, the domains are checked at install time, and there is no means to add new domains except by shipping a new edition of the app with a new manifest.

I was wondering if there is a way to support many subdomains without having to specifiy them all in the intent-filter tag.

No, sorry. Android checks the domains and retrieves the JSON file at install time.

I thought a regex would work but apparently that's not supported when defining the host

You cannot download JSON from a regex.

I don't want to list all of them since that would mean having to push a new release with every new subdomain created

Then either support some common subset, or do not support app links for now. It is conceivable, if somewhat unlikely IMHO, that Google will offer more flexible options for this in the future.

这篇关于多个子域名支持与App链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆