1

I have implemented custom URL schema in my project and working fine till iOS12.But not in iOS13.

For iOS13 I have added class SceneDelegate.swift and implemented below methods:

  func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// added navigation functionality for iOS13
}
     func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {

    print("url:\(URLContexts.first?.url)")

}

for below ios13:

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {

}

Please help me to solve this issue.

Thank you.

user2931321
  • 468
  • 1
  • 7
  • 28
  • This is a duplicate. Check the answer here: https://stackoverflow.com/a/59370832/73195 – Hejazi Dec 17 '19 at 11:06
  • Does this answer your question? [Method 'scene(\_:openURLContexts:)' is not called](https://stackoverflow.com/questions/58973143/method-scene-openurlcontexts-is-not-called) – Hejazi Jan 14 '20 at 19:31

1 Answers1

0

Have you checked the LSApplicationQueriesSchemes in your Info.plist? Your custom URL schema must be mentioned there.

Maybe you can share with us your test project with this issue so we can run it?

Mike
  • 51
  • 1
  • 8
  • Added LSApplicationQueriesSchemes and URL types with schemas in plist.Everything is working in iOS12 issue with iOS 13 only. – user2931321 Nov 14 '19 at 08:51
  • Could you please add more information about - what happens? I have application that opens FB app and everything that I've done to do this is added *fb://feed* into LSApplicationQueriesSchemes, and wrote a code: fileprivate func openFacebookApp() { guard let url = URL(string: "fb://feed"), UIApplication.shared.canOpenURL(url) else { return } UIApplication.shared.open(url) } – Mike Nov 14 '19 at 08:59