In Swift 4 it’s working fine in all device and iOS versions.
After upgrading to swift 5 deeplink open the app, But userActivity method is not called.
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
guard userActivity.activityType == NSUserActivityTypeBrowsingWeb,
let url = userActivity.webpageURL
else { return false }
print(url)
return true
}
Our App support iOS 10 and above.
2
Answers
restorationHandler
Callback type has been changed from[Any]
to[UIUserActivityRestoring]
then it's working fine for me.if you set the initial viewController via SceneDelegate. You need to add this to SceneDelegate