我試圖避免每次會話在Spotify for SDK中過期時彈出授予用戶的權限。Spotify SDK缺少令牌刷新服務?
流行一小時後出現,也許一個彈出似乎再次授予權限的用戶,這樣他可以從Spotify的我的應用程序播放曲目,我得到的錯誤時嘗試更新會話:
[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
在這裏我如何試圖續訂會議:
//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)
}
})
}
任何解決方案呢?
目前有可能在SDK它自身的問題。獲得加密的刷新令牌零,因此無法更新會話。 https://github.com/spotify/ios-sdk/issues/880臨時我解決了使用棄用SPTAuthViewController的問題,我嘗試了所有方法,並投入了將近36小時的時間來獲取刷新令牌。 –