Announcements

Unable to connect appRemote on app after a while if Spotify is in background

Reply
Highlighted

Unable to connect appRemote on app after a while if Spotify is in background

Casual Listener

I'm currently implementing the Spotify app remote into my application but after a while if the Spotify app is in the background and I try to connect the Spotify app by waking it up from my app, I get this error.

 

Error Domain=com.spotify.app-remote Code=-1000 "Connection attempt failed." UserInfo={NSLocalizedDescription=Connection attempt failed., NSUnderlyingError=0x2813dddd0 {Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x2813deee0 {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.}}, NSLocalizedRecoverySuggestion=Ensure the Spotify app is installed, and try to reconnect., NSLocalizedFailureReason=Could not connect to the Spotify app.}

 

I do set the configurations playURI to an empty string "" and music is playing when I attempt to connect the Spotify app remote but it still comes up with this error. I would have to force quit Spotify which at that point will connect the app remote but that is just impractical.

 

Anyone figure out a way around this or have the same problem?

SUGGESTED POSTS