spotify / android-sdk

Spotify SDK for Android
https://developer.spotify.com/documentation/android/
Apache License 2.0
454 stars 117 forks source link

unsubscribe PlayerState #315

Open dariustayebi opened 2 years ago

dariustayebi commented 2 years ago

I'm wondering why there's no way to unsubscribe the PlayerState? It's necessary in many cases

tobika commented 2 years ago

When you subscribe you receive a Subscription Object. Did you try using cancel()? https://spotify.github.io/android-sdk/app-remote-lib/docs/com/spotify/protocol/client/Subscription.html

dariustayebi commented 2 years ago

Thanks for your reply. Now I think my issue is not related to the playerstate. so in my app PlayerApi.play() works 90% of the time but sometimes for any reason it just doesn't work and I can't see why. Connection looks all good as well as the parameters but just play() function looks to be not working. It's hard to replicate as it only happens randomly 10% of the time. I'm wondering if there's any known issues?