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
iOS Controlling Uiview Alpha Behaviour for Subviews
Uicontroleventtouchdragexit Triggers When 100 Pixels Away from Uibutton
Push Notification -Didfinishlaunchingwithoptions
Avspeechsynthesizer Output as File
Responding to Ram Availability in iOS
How to Specify a Platform Target When Running Swift Test from the Cli
Not Getting Email and Public Profile Using Facebook 4.4.0 Sdk
How to Install an Unsigned IPA File on My Device Using an Apple Developer Account
Issue with Uitableview: Action Only Works Every Second Time
Can't Load Uiviewcontroller Xib File in Storyboard in Swift
Setkeepalivetimeout iOS Behavior, Exceeded 15 Wakes in 300 Sec
How to Convert Fbprofilepictureview to an Uiimage
How to Identify iOS Device Uniquely
Get Error Code -11843 While Exporting Mp3 File in Ipod Library Since iOS 5.1
How to Access an Xcassets Directory on the Filesystem
How to Get Index Path of Cell on Switch Change Event in Section Based Table View