Reputation: 125
This may be a newbie question.
When Application in the background and I click the scheme URL (something like "myApp://blabla") to launch the app, open url methods work fine. No problem.
But when the app doesn't in the background or killed by swiping up, and after that I click the url(myApp://blabla) the app launches but doesn't call the openUrl methods in AppDelegate.
So, I can't navigate the app correctly.
Solved: As @ctietze told, didFinishLaunchingWithOptions wasn't return true, that was the problem.
Upvotes: 4
Views: 5935
Reputation: 41
One solution is to comment out the SceneDelegate
file, delete ApplicationSceneManifest
in info.plist
, then restart Xcode. Then the function will be called.
Upvotes: 0
Reputation: 5075
Make sure you have added "myApp" all details under URL types in info.plist file. You need to add two keys in it. Check image below:
Upvotes: 0
Reputation: 27211
In this case you have to check didFinishLaunchingWithOptions
delegate method
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if let url = launchOptions?[UIApplication.LaunchOptionsKey.url] as? URL {
/// some
}
return true
}
Upvotes: 1