是否可以使用动态 link 从 2 个不同的域 link 到同一个应用程序?

Is it possible to link from 2 different domains to the same app using dynamic links?

我有 2 个域和一个应用程序,但会 link 通过深层链接从两个域到应用程序页面。

是否可以 link 从 e. G。 static.domain.com 和 content.domain.com 都进入同一个具有动态 link 的应用程序? 提前致谢:)

当然,您可以根据需要添加任意多个域。 只需在清单中添加您的域。

<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.jsonhttps://content.domain.com.com/.wll-known/assetlinks.json 访问。应该使用 https 来验证您的域。

干杯