Application(...Continue Useractivity...) Method Not Called in iOS 13

continueUserActivity not called from search closed app

Here it follows the complete answer following your advices.

// In application: didFinishLaunchingWithOptions:
NSDictionary *activityDic = [launchOptions objectForKey:UIApplicationLaunchOptionsUserActivityDictionaryKey];

if (activityDic) {
if(self.window.rootViewController){
NSUserActivity * userActivity = [activityDic valueForKey:@"UIApplicationLaunchOptionsUserActivityKey"];
[self.window.rootViewController restoreUserActivityState:userActivity];
}
}

iOS Swift 5 Deeplink userActivity Method not called

restorationHandler Callback type has been changed from [Any] to [UIUserActivityRestoring] then it's working fine for me.

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
}

iOS, Universal links, Swift. continueUserActivity not calling

I suspect this is because you've marked the continueUserActivity function as private. I've never seen that, and in fact Swift 3 actually gives an error when I try. There don't appear to be any examples of code structured that way on all of GitHub.

I'd suggest removing the private scope.

application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) - Void) - Bool { } not called

The problem is that you are returning false from didFinishLaunching. That prevents continue from being called.



Related Topics



Leave a reply



Submit