Announcements

Help Wizard

Step 1

NEXT STEP

Access token missing in SceneDelegate callback

Access token missing in SceneDelegate callback

 

Plan:

Premium

Country:

USA

 

Device

iPhone 7

Operating System

 

 

iOS 13.4.1

 

I've been working on changing my test app to use token swap. I modeled the client after the example here: (https://github.com/spotify/ios-sdk/tree/master/DemoProjects/SPTLoginSampleAppSwift/SPTLoginSampleApp...). Since my app is newer it uses SceneDelegate instead of AppDelegate. When I get the callback to func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>)

I do the following:

        let parameters = appRemote?.authorizationParameters(from: url);

        let access_token = parameters?[SPTAppRemoteAccessTokenKey]

 

but there are no parameters. What could cause this? Is there some way to enable more debugging output?

 

Reply
4 Replies

I have the same issue, the callback is providing a code but it's not the access_token.
It looks like this:
com.blabla.myapp://callback/?code=AQBAGHbWnEzFf_rs_tCshMooN2233GqbWj6EtEUaXxKx_TBVOYzySTIxR-n3Y5vH4zZJNtjAddJBbYYMg5AGNeEAGxjETfTrYZAteDJRcNsY_LB-lXzBFL5BrAZY93X8x30MHgimYnMpnHC-qzYUWd2coZ7DJvkzy2U2fi1zkSVfcIlWgDaCsc-BdCEJ3z78Cz8qDP70CB3daVKf1gjSZPKGiXqaDVJbJ0R10OUI6gYjo6J1Dk8b5Wle19Lfe3bLFqcuGFM98d-i1ZftvTYdy7U7nWA5kWAtgXJvJ92RFQ2xPWs_X7mYv92D6J9_MrFHxKfcaTury925zZJTlP882m_B35pCVTS8H5QQUQ6RBe15dPsEjn31-ocE45O-UiqkOg-zmgRnLpizNDPQUmbt1w&spotify_version=8.6.22.1228

Had the same issue!

 

The reason why every Spotify API using program broke, is because their ssl fingerprint has changed. After I changed that to the current one in the code, everything works fine.

Sorry can you explain what ssl fingerprint are you referring to? How did you change that in your code? I'm facing the same issue.

The access token won't be in this URL. That's expected. Read the authorization guide for the Authorization Code Flow for more information. When your application receives the callback URL, you should call `SPTSessionManager.application(_:open:options)`, as demonstrated in the example you linked to here. If you're using the newer scene delegate (or SwiftUI), then you can pass in `UIApplication.shared` for the `app` parameter, and omit the `options` parameter.

Suggested posts