【发布时间】:2019-03-18 14:52:16
【问题描述】:
我创建了一个启用通用链接的演示项目,并按照以下所有步骤操作 -
- 在 AppId 中启用关联域
- 编辑配置文件
- 在项目中 - 启用关联域并添加域链接 (mobiledemo.socialengineaddons.com),不会出现任何错误
- 域链接也显示在 seiosnativeapp.entitlements 文件中
- 我在 Copy Bundle Resources (Build Phases) 中手动添加了 seiosnativeapp.entitlements 文件
-
在 AppDelegate 中处理链接活动 (Swift 4.2 ,Xcode 10.1) - 应用代理:
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restoreHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
print("Activity") if userActivity.activityType == NSUserActivityTypeBrowsingWeb { let url = userActivity.webpageURL! print(url.absoluteString) //handle url and open whatever page you want to open. } window = UIWindow(frame: UIScreen.main.bounds) let ViewController = UIViewController() window?.rootViewController = ViewController window?.makeKeyAndVisible() return true}
我的 AppId 和前缀都一样
-
创建一个 apple-app-site-association 文件并放在 .well-known 文件夹:
https://mobiledemo.socialengineaddons.com/.well-known/apple-app-site- 联想
-
我的域名也是 ssl 认证的,我也使用过这个命令 删除验证器错误 -
Sign apple-app-site-association 联想
sudo touch json.txt | openssl smime -sign -inkey myserver.key -signer mobiledemo.socialengineaddons.com.crt -noattr -nodetach -outform DER
苹果应用网站关联
-
链接验证器:成功验证域 (mobiledemo.socialengineaddons.com)
https://branch.io/resources/aasa-validator/#resultsbox https://limitless-sierra-4673.herokuapp.com/
注意:当我们将 apple-app-site-association 文件放在 root 时,验证器 给出错误,所以我们把它放在 .well-known 文件夹中 11. 当我在 Notes(IOS 应用)上添加我的网站链接时 https://mobiledemo.socialengineaddons.com 并长按,不是 当我单击此链接时,也显示在我的应用程序中打开的任何打开 每次它在 safari 而不是应用程序中打开 12. 我按照以下参考链接:
https://medium.com/@abhimuralidharan/universal-links-in-ios-
79c4ee038272
https://www.raywenderlich.com/6080-universal-links-make-the-
connection
https://www.youtube.com/watch?v=IEXn7QIwPFo
13.如果您提供任何建议,这对我很有帮助 使能够 通用链接,提前致谢 [1]:https://i.stack.imgur.com/rQBTW.png [2]:https://i.stack.imgur.com/esB8f.png
[1]: http://%20com.seao.seiosnativeapp
【问题讨论】:
-
aasa 文件中的 applinks 键在哪里?