1

When use third-party login ,in the function func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool, the UIApplication.OpenURLOptionsKey.sourceApplication is nil on iOS 13.

Why? And how to fix this?

Thanks

magic_9527
  • 243
  • 3
  • 18
  • In iOS 13 it is the scene delegate that is called, not the app delegate. – matt Feb 19 '20 at 04:17
  • It might be that you need to use the Scene Delegate instead on iOS 13. https://stackoverflow.com/questions/56508764 – vikingmobile Feb 19 '20 at 04:18
  • 1
    @matt the func `func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool` is called, it just the key **UIApplication.OpenURLOptionsKey.sourceApplication** is nil. I tried add `func scene(_ scene: UIScene, openURLContexts URLContexts: Set)` but it is not called. – magic_9527 Feb 19 '20 at 05:49
  • Because `scene(_:willConnectTo:options:)` is called instead (at launch). – matt Feb 19 '20 at 06:07
  • @matt I confirmed to the protocol **UISceneDelegate** and but func `func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)` isn't called. It remains called `func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool` – magic_9527 Feb 19 '20 at 08:15

0 Answers0