Spotify SDK Token update service missing?

I am trying to avoid pop-up permission for the user every time the session in the Spotify for SDK has expired.

The pop appears after an hour, maybe the popup again gives permission to the user, so he can play tracks from Spotify in my application, the error I get when I try to extend the session:

[PLAYER][PLAY][SPOTIFY] Error renew Session Optional(Error Domain=com.spotify.auth Code=0 "Missing token refresh service." UserInfo={NSLocalizedDescription=Missing token refresh service.}) [PLAYER][SPOTIFY] Session could not be renewed,popup login 

and this is how I try to update the session:

 //Renew Session func renewSession(completion:@escaping (Bool)->()) { print("[PLAYER][PLAY][SPOTIFY] Renew Session requested ") let auth = SPTAuth.defaultInstance() auth?.renewSession(auth?.session, callback: { (error, session) in if (error != nil) { print("[PLAYER][PLAY][SPOTIFY] Error renew Session \(String(describing: error))") completion(false) return } auth?.session = session if auth?.session.isValid() == true { print("[PLAYER][PLAY][SPOTIFY] Renew Session Success") completion(true) }else { print("[PLAYER][PLAY][SPOTIFY] Renew Session Failed") completion(false) } }) } 

any solution for this?

+8
ios spotify swift3 session
source share
1 answer

Have you assigned these properties to your SPTAuth object?

[SPTAuth defaultInstance].tokenSwapURL = [NSURL URLWithString:@"swapURL"]; [SPTAuth defaultInstance].tokenRefreshURL = [NSURL URLWithString:@"refreshURL"];

Taken from https://github.com/spotify/ios-sdk/issues/427 , which may have more information if this is not enough.

There is also a link for the SPTAuth class:

https://spotify.imtqy.com/ios-sdk/Classes/SPTAuth.html

+1
source share

All Articles