我已经通过以下步骤在我的应用中实现了通用链接:-
- 在证书中启用应用域并创建配置文件
- 安装证书和配置文件
- 在功能中开启关联域
- 输入我必须执行通用链接格式的链接 (applinks:www.xxxxxxx.com)
- 交叉验证 .entitlements 文件
- 在权利文件的身份和类型中,目标成员框已被选中
txt 文件已上传到服务器,格式为:-
{"applinks": {"apps": [], "details": [{"appID": "teamId.com.abcd.efgh", "paths": ["*"]}]}}
检查显示的站点
a) 苹果验证器 enter image description here
b) aasa 验证器 enter image description here 
在我的 appDelegate 中实现了函数,但它从未被调用过
func application(_ application: UIApplication, continue userActivity: NSUserActivity,restorationHandler: @escaping ([Any]?) -> Void) -> Bool {}
我的通用链接不起作用我无法从笔记中的链接或任何地方重定向我的应用程序。我 已经实现了我所知道的所有必要步骤。我无法调试该问题。
最佳答案
您的 AppDelegate 实现尚未完成,您需要从收到的 NSUserActivity 对象中获取您的 url,如声明的 here在苹果文档中,使用以下方法来完成您的 appDelegate 实现:
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL
else
{return false}
return true
}
然后,您可以使用此 url
并将其发送到任何要加载它的 ViewController。
希望这有帮助;)
关于ios - 通用链接无法快速工作 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47049773/