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?
ios spotify swift3 session
Jack
source share