ios-sdk
ios-sdk copied to clipboard
SessionManager didFailWith Network connection was lost
Behaviour
The authorization flow with session manager works fine the first time (sometimes first few times). However, after a few attempts of initiating a session, then deleting it and resetting the session manager, the sessionManager didInitiate callback is no longer called and instead it results into an error:
Device (iPhone 13)
Operating System (iOS 16.3.1)
SDK version 1.2.3
Error Domain=com.spotify.sdk.login Code=1 "(null)" UserInfo={NSUnderlyingError=0x1130b8c60 {Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=53, NSUnderlyingError=0x123d531a0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <6032FBBC-C741-4911-8C24-B715DDBAF52C>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <6032FBBC-C741-4911-8C24-B715DDBAF52C>.<2>" ), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://accounts.spotify.com/api/token, NSErrorFailingURLKey=https://accounts.spotify.com/api/token, _kCFStreamErrorDomainKey=1}}}
This seems a bit odd as I have absolutely no network connection problems and I don't know what else could be causing this.
I am not using a server for token swap/refresh, I let the Spotify SDK use the PKCE flow. I also tried this flow while using Instrument's Network monitor and it does not occur this way at all.
Does anyone has any suggestions or explanations on what's happening and how I can solve this? Thank you!
Same issues here as well. I had to force quit the spotify app for the authentication flow to work again.