我有以下情况:
此处的预期结果是处理此链接的操作,例如转到给定的View Controller,但什么也没有发生。
在iOS上受支持,因为这种情况在Android上适用吗?
这是我的代码:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
if let activityDictionary = launchOptions?[.userActivityDictionary] as? [String : AnyObject],
let userActivity = activityDictionary["UIApplicationLaunchOptionsUserActivityKey"] as? NSUserActivity {
return handleDynamicLink(userActivity: userActivity)
}
return true
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity,
restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
return handleDynamicLink(userActivity: userActivity)
}
private func handleDynamicLink(userActivity: NSUserActivity) -> Bool{
// Handling here ...
return true
}
这是看起来不错的诊断报告:
---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 2.3.2
System information: OS iOS, OS version 11.2.1, model iPhone
Current date 2018-07-05 07:16:14 +0000
Device locale en-GB (raw en_GB), timezone Europe/Sofia
Specified custom URL scheme is com.app and Info.plist contains such scheme in CFBundleURLTypes key.
AppID Prefix: 123, Team ID: 123, AppId Prefix equal to Team ID: YES
performDiagnostic completed successfully! No errors found.
---- Firebase Dynamic Links diagnostic output end ----