From d4279629548446dfb43c690e9ce41b454e8336cc Mon Sep 17 00:00:00 2001 From: canalun Date: Wed, 10 Mar 2021 03:28:46 +0900 Subject: [PATCH] modify the part of "set up appdelegate" in README.md for getting responsive to iOS 13 and above --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f26956..18fc225 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,30 @@ Add the app's identifer as the **Identifier** and the redirect url scheme in **U Additionally, you will need to add "spotify-action" to the LSApplicationQueriesSchemes key: ![LSApplicationQueriesSchemes](https://user-images.githubusercontent.com/889949/29968001-f020c4d4-8f19-11e7-8925-433d3b30f842.png) -### Set up your AppDelegate +### Set up your AppDelegate and SceneDelegate (for iOS 13 or above) + +Add the following to your app delegate: + +```swift +func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + SpotifyLogin.shared.configure(clientID: <#T##String#>, clientSecret: <#T##String#>, redirectURL: <#T##URL#>) + return true +} +``` + +Add the following to your scene delegate: + +```swift +func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { + guard let url = URLContexts.first?.url else { + return + } + let handle = SpotifyLogin.shared.applicationOpenURL(url) { (error) in } + return +} +``` + +### Set up your AppDelegate (for iOS 12 or below) Add the following to your app delegate: