ios:通用链接无法在iOS 10上运行
我正在尝试在我的iOS应用中集成通用链接。 因此,每当有人点击.herokuapp.com/content
会直接重定向到应用。 我按照本指南进行设置。 我做了以下设置,但无法使其正常工作。 我还检查了stackoverflow上的其他线程,但没有一个解决了这个问题。
- 在我的应用目标上的function选项卡中添加了关联域。 添加了两个域:
activitycontinuation:.herokuapp.com
和applinks:.herokuapp.com
。 - 在Build Phases> Copy Bundle Resources中添加了文件.entitlements。
- 从https://developer.apple.com/account/#/membership获得teamId
-
在我的网站上为
https://.herokuapp.com/apple-app-site-association
添加了一个apple-app-site-association
路由,返回以下json:{ "applinks": { "apps": [], "details": [ { "appID": "..dev", "paths": [ "*" ] }, { "appID": ".", "paths": [ "*" ] } ] }, "activitycontinuation": { "apps": [ "..dev", "." ] } }
-
已安装应用程序从Xcode到iPhone 6s Plus(物理设备),包ID为
.dev
并将链接https://.herokuapp.com/content
复制到Notes但在Safari中打开。
修复了这个问题。 问题是我正在使用Debug配置进行测试。 当我尝试使用Release版本时,现在一切正常。
有很多问题可能阻止您的Universal Links在这里工作。
以下是一些需要仔细检查的内容:
- AASA文件是否正确命名并正确签名?
- 你在使用物理设备进行测试吗? (有人说Universal Links现在在iOS 10的模拟器中一直工作,但我仍然使用物理设备)
- 您的设备和配置证书是否都没有错误?
- 由于网络连接问题,首次安装/启动应用程序时,AASA文件无法更新(例如,如果Charles Proxy正在捕获流量,我发现AASA将无法下载)
- 在测试时,您是首先将链接粘贴到Notes中然后长按它吗? 您是否看到“在应用程序中打开”菜单选项? 如果是这样,Universal Linking正常工作,并且刚刚在设备上禁用。
我还建议您浏览Alex Austen关于此主题的超级博客文章,因为这样做可能会帮助您发现问题(例如: https : //blog.branch.io/how-to-setup-universal-links-to-deep -link-on-apple-ios-9 / )。
Branch有许多工具/资源可用于识别通用链接问题。 它们专门用于分支链接,但您仍然可以发现它们很有帮助:
- AASA Validator: https : //branch.io/resources/aasa-validator/
- 通用链接validation器: https : //dev.branch.io/getting-started/universal-linking-validator/guide/
- 通用链接故障排除指南: https : //support.branch.io/support/solutions/articles/6000153326-ios-universal-links-troubleshooting-guide
将您的域粘贴到此链接并检查它是否存在问题