IOS/iOS

[iOS] URL Scheme 다루기, 호출 메서드 2개 처리 방법

https://celsiusnotes.com/url-schemes-in-ios/

 

Custom URL Schemes in iOS

URL schemes are essentially just specially formatted URLs linking to content within your app. You can use URL schemes in your iOS (and also macOS) apps to implement deep-linking and also to give third-party apps the ability to open your app. You could, for

celsiusnotes.com

일반적인 URL Schemes핸들링의 경우 다수의 블로그에서 13버전 이상의 SceneDelegate에서 호출되는 메서드에 대해서 설명을 잘 안해주더라구요

위의 글에서는 호출되는 메서드 두가지에 대해 설명하고 있으니 살펴보시면 아실수 있습니다 ㅎㅎ

- 앱이 작동중이지 않을 때 호출되는 메서드

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions)

- 앱이 백그라운드 또는 포그라운드 상태에서 호출되는 메서드

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)