JoshLmao / Spotify4Unity

🎮🎵 Add the SpotifyAPI.NET library into Unity, enabling access to the Spotify Web API, allowing for control of Spotify and accessing the world of music
https://assetstore.unity.com/packages/tools/integration/spotify4unity-ui-tools-spotify-authorization-129028
MIT License
94 stars 8 forks source link

Connect does not work after calling Disconnect #13

Closed Eyliess closed 5 years ago

Eyliess commented 5 years ago

Due to the way my Unity application is run, it will sometimes be completely frozen for unknown periods of time which seems to lead to the Spotify Service not being able to re-auth the user.

To combat this issue, I wanted to add a reconnect button - I called SpotifyService.Disconnect, and then SpotifyService.Connect a few seconds later (tried with up to 60). Once the connect method is called, the OnConnectionChanged method in SpotifyUIBase gets called with the result being that IsConnected is true.

Despite this, none of the SpotifyUIBase methods get called almost as if the service was not actually connected.

JoshLmao commented 5 years ago

Hey, massive apologies for the slow reply! I was on holiday all of last month so thank you for being patient 😊

I took a look and realized my issue and this should now work. I've added a Disconnect button to the ExamplePlayerController too. I'll release and update asap and close this when the update is live on the store

Eyliess commented 5 years ago

Thanks a lot! Hope you enjoyed the vacation. Once that update is ready I'll be able to release my application!

JoshLmao commented 5 years ago

That's good to hear! The update is live on the Asset Store now so update the package and you should be good to go. And I did, thank you 😊