You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to implement handling for when an authenticated user switches their Spotify account and found that there seems to be a bug in the Spotify app here. I've also been able to observe and reproduce the same issue in other AppStore apps with Spotify integration.
The issue can be reproduced with using both SDK provided authentication methods:
Receiving access token by calling SPTAppRemote authorizeAndPlayURI:completionHandler:
Receiving access token by calling SPTSessionManager initiateSessionWithScope:options:campaign:
The steps to reproduce are:
User is signed into Account 1 in Spotify app and connects an App through the SDK and receives AccessToken 1.
App then successfully connects to SPTAppRemote using the received AcessToken 1.
User goes to the Spotify app and signs out of Account 1 and then signs into Account 2.
User opens App and tries to connect to the SPTAppRemote using AccessToken 1.
Connection attempt fails and appRemote:didFailConnectionAttemptWithError is called. (Expected as accessToken 1 was for Account 1)
User successfully re-authenticates app for Account 2 through the SDK and receives AccessToken 2.
App tries to connect to running Spotify app through SPTAppRemote using AccessToken 2.
Connection attempt fails and appRemote:didFailConnectionAttemptWithError is called (Unexpected)
When is this state all future connection attempts will fail even if connecting app is restarted, new access token fetched successfully (SPTAppRemote and or SPTSessionManager with new initiateSession). Only way to recover from this state I have found is to force-close to Spotify app. After this the app can successfully connect to the Spotify App through the SDK again.
Repeated error received in appRemote:didFailConnectionAttemptWithError when calling appRemote.connect() with valid accessToken this state: AppRemote: Connecting... AppRemote: Failed connection attempt with error: Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x300208c60 {Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSLocalizedRecoverySuggestion=Reconnect the transport to the Spotify app., NSLocalizedFailureReason=A stream error has occured in the transport.}
The text was updated successfully, but these errors were encountered:
Fump
changed the title
Spotify app refuses app connection attempts after switching Spotify account until re-started
Spotify app refuses app connection attempts after switching Spotify account
Jun 18, 2024
I've been trying to implement handling for when an authenticated user switches their Spotify account and found that there seems to be a bug in the Spotify app here. I've also been able to observe and reproduce the same issue in other AppStore apps with Spotify integration.
SDK version: 2.1.1
Spotify iOS App version: 8.9.48
The issue can be reproduced with using both SDK provided authentication methods:
The steps to reproduce are:
When is this state all future connection attempts will fail even if connecting app is restarted, new access token fetched successfully (SPTAppRemote and or SPTSessionManager with new initiateSession). Only way to recover from this state I have found is to force-close to Spotify app. After this the app can successfully connect to the Spotify App through the SDK again.
Repeated error received in appRemote:didFailConnectionAttemptWithError when calling appRemote.connect() with valid accessToken this state:
AppRemote: Connecting... AppRemote: Failed connection attempt with error: Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x300208c60 {Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSLocalizedRecoverySuggestion=Reconnect the transport to the Spotify app., NSLocalizedFailureReason=A stream error has occured in the transport.}
The text was updated successfully, but these errors were encountered: