【问题标题】:Is it possible to link from 2 different domains to the same app using dynamic links?是否可以使用动态链接从 2 个不同的域链接到同一个应用程序?
【发布时间】:2018-01-22 10:25:02
【问题描述】:
我有 2 个域和一个应用程序,但会通过 Deep-Links 从两个域链接到应用程序页面。
是否可以从 e 链接。 G。 static.domain.com 和 content.domain.com 都通过动态链接进入同一个应用程序?
在此先感谢:)
【问题讨论】:
标签:
deep-linking
firebase-dynamic-links
firebase-app-indexing
【解决方案1】:
当然,您可以根据需要添加多个域。
只需在清单中添加您的域。
<data android:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
所以,代码如下所示:
<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:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
</intent-filter>
不要忘记通过在 .well-known 文件夹中添加assetlinks.json 来验证您的域。确保可以使用 https://static.domain.com/.wll-known/assetlinks.json 和 https://content.domain.com.com/.wll-known/assetlinks.json 访问它。应该使用 https 来验证您的域。
干杯