func application(_ app: UIApplication, open url: URL, options:
[UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if let isDynamicLink = DynamicLinks.dynamicLinks() .shouldHandleDynamicLink(fromCustomSchemeURL: url) {
let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url)
return handleDynamicLink(dynamicLink)
}
return true
}
答案 0 :(得分:4)
shouldHandleDynamicLink
上⌥单击,您将看到声明
func shouldHandleDynamicLink(fromCustomSchemeURL url: URL) -> Bool
返回类型是非可选的。删除可选的绑定
func application(_ app: UIApplication, open url: URL, options:
[UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if DynamicLinks.dynamicLinks().shouldHandleDynamicLink(fromCustomSchemeURL: url) {
let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url)
return handleDynamicLink(dynamicLink)
}
return true
}