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.
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 }
One solution is to comment out the SceneDelegate
file, delete ApplicationSceneManifest
in info.plist
, then restart Xcode. Then the function will be called.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.