Android 深层链接 - 允许使用子域 URL,在组织域上使用 assetlinks.json?

Android deep links - allow use of subdomain URLs, with assetlinks.json on organizational domain?

我已经使用 Android App Studio 的 App Links Assistant 将我的 URL 映射到 MainActivity.kt,我可以点击电子邮件中的 link 打开我的模拟器中的应用程序。

准确声明时的 URL 映射,例如https://myorg.com/open-in-app,根据需要打开应用程序。

如果我通过使用 HTTPS 实现 link 包装的电子邮件服务传递我的电子邮件,我必须使用子域。因此,例如包装 link 可以看起来像

https://track.myorg.com/open-in-app/xyzzy

在 iOS / Xcode 中,我可以为给定的应用程序设置多个域关联,子域使用通配符 here. iOS fetches the apple-app-site-association file from the subdomain's, or the organizational domain's /.well-known path. Apple recommends the org domain in the first instance here,这对于支持同一个应用程序很方便在多个子域上。

注意:可以在子域上托管 assetlinks.json 文件,但这样做有点复杂(例如使用 CDN)。 https://track.myorg.com 通常映射到电子邮件服务,其中 returns 重定向到登录页面。对于未使用该应用程序的每个人,link 将在他们的浏览器中打开。

在 Android 中是否有等效项,即将 assetlinks.json 文件托管在一个地方 - 在 org 域上 - 仍然很深 link 到 URLs有子域名?

在 Android Studio 模拟器上测试,设备 Pixel 2,Android API 级别 30。

assetlinks.json 文件可以从 link 的组织域中获取,或者从 link 的实际 (sub-domain) 中获取。

sub-domain 也可以通过 301 重定向工作,这对于某些 CDN(例如 CloudFlare)是必需的。其他(例如 AWS CloudFront)可以直接托管文件。

另请参阅:this article