通用链接不起作用,横幅未在 Safari 中显示

Universal Links not working and banner is not showing in Safari

我正在我的应用程序中处理通用链接。

当 url 点击 Safari 时,它应该会在 Safari 浏览器顶部的横幅中显示打开应用程序的选项,但我没有看到它。

我创建了 apple-app-site-association 并将其托管在我的后端。当我检查它时 https://www.xxxxx.com/apple-app-site-association 。我可以看到 app-site-association 文件。

在权利中,我在项目 applinks:v100.xxxxxx.com/reset_password* 下添加了关联域。 link 是 https://v100.xxxxxxx.com/reset_password?token=6d3ec67ff5bbf2214c895839c125e8f80ec83a90 而 apple-app-site-association 是这样的

{
 "applinks": {
 "apps": [],
 "details": [
 {
  "appID": "Teamid.Bundelid",
  "paths": ["*"]
 }
{
"appID": "appid.Bundelid",
"paths": ["*"]
}
]
}
}

感谢您的快速回复。

要使用 iOS 应用程序的横幅提示浏览器用户,您必须将此行添加到 HTML,其中不包含通用 Links。

<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">

实施通用 Links 时,您要注意用户甚至不会访问 Safari 浏览器,而是直接转到您的应用程序。 Universal Links 的配置似乎没问题。每次更改任何通用 Link 配置时,请确保从设备中删除您的应用并重新安装它。如果您想阅读更多相关信息,我推荐这些链接

https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html

https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/UniversalLinks.html

https://medium.com/@abhimuralidharan/universal-links-in-ios-79c4ee038272

如果通用链接配置正确,应该会显示此横幅。您的通用链接似乎未配置。

您权利的关联域有 LINK,而不是 DOMAIN

乍一看,您的权利文件似乎包含完整的 URL,而实际上它应该只包含域。将您的权利更改为 applinks:v100.xxxxxx.com 而不是 applinks:v100.xxxxxx.com/reset_password*。如果还是不行,请继续阅读

还是坏了?试试这些步骤

您的 AASA 文件似乎已正确托管,因此我建议您尝试以下步骤:

1) 确保您的权利文件包含在您的项目中。这是下载 AASA 所必需的。确保您的域是正确的。

2) 检查您的 phone 是否为 运行 iOS 11.2。这个版本的 iOS 有时在实际下载 AASA 文件时遇到问题。要解决此问题,您应该删除该应用程序,重新启动 phone,然后重新安装。我建议检查设备日志以查看它是否安装正确。 (为了理智,我建议您在更新 AASA 时这样做)

3) 检查您是否在您的应用中禁用了通用链接(可能不是您的问题,但请检查)。您可以通过将 link 复制到 Notes 应用程序然后长按它以提示执行操作 sheet 来执行此操作。如果您看到 "Open in App name",那么您可以 select 打开该应用程序的通用链接。如果您没有看到,则 AASA 文件未下载或配置不正确。

4) 使用 Branch's iOS SDK 进行深度 linking。它将为您节省大量的调试时间。他们为您处理 AASA 文件,并提供延迟的深度 linking 解决方案和其他边缘情况。