有没有办法从 Safari 检查通用 link 注册?

Is there a way to check universal link registration from Safari?

iOS 具有通用的 link 能力 (https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html)。

但是,似乎有几种方法可以从应用程序中 "disassociate" link:

一旦您执行其中一项操作,通用 link 将在 Safari 中打开(直到您将其重新关联回应用程序)。

问题是,如果用户最终处于这种状态,则不清楚 he/she 应该做什么。我想在将在 Safari 中打开的网页上提供解释。

不过,我想区分两种情况:

有没有办法检查在 Safari 中打开的页面是否注册了通用 link?

是的,您是正确的 iOS11 去掉了右上角的按钮以重新启用通用链接。他们保留了当您稍微向上滚动页面时显示的横幅。

此横幅行为还将为用户重新启用通用链接。

遗憾的是,没有完美的解决方案来确定用户是否安装了该应用程序,但是有几种方法可以尝试推断用户是否已经安装了该应用程序。 Branch has ways of deducing whether the user has the app installed and attempting to open it with a URI scheme. You can read about the $uri_redirect_mode in the docs

自己构建这个推导方法会非常困难,我也不完全确定它是如何完成的,所以我建议使用 Branch 的解决方案。