android-sdk
android-sdk copied to clipboard
OnReceive triggered multiple times for each broadcast
Issue found on 01/12/2020
SDK Version:
spotify-app-remote-release-0.7.1
OS Version:
android compileSdkVersion 30 buildToolsVersion "30.0.2"
Scope(s):
"user-library-read", "playlist-read-private", "playlist-read-collaborative", "user-read-email", "user-read-private"
Steps to reproduce:
- User opens app
- Spotify OAuth carried out successfully
- Playlists correctly displayed
- User chooses playlist and song
- Song correctly plays
- Broadcast sent from Spotify to app
- METADATA_CHANGED and PLAYBACK_STATE_CHANGED broadcasts correctly received with correct variables in intent
- Two further broadcasts with duplicate variables are then received except for the timeSentInMs variable (difference in times between broadcasts is ~100ms)
In total, three duplicate broadcasts are sent each time there is any playstate change i.e. pausing, skipping, etc
The same thing happened when downloading another user's Github project which received broadcasts in the same manner
Expected behaviour:
One broadcast was expected to be received which the app can read and handle accordingly
Actual behaviour:
Three broadcasts are received causing the app to incorrectly handle the information - requiring extra coding effort