Announcements

Help Wizard

Step 1

NEXT STEP

iOS SDK: Don't call playerStateDidChange for unidentified events. Add event types.

iOS SDK: Don't call playerStateDidChange for unidentified events. Add event types.

The iOS SDK works great for simple applications. The demo app, for example, is infallible. The album art and other album information changes in-place when the playback state is updated. Add a simple print to playerstateDidChange with the song title and position, and a huge problem reveals itself.

 

When a song changes, playerStateDidChange is called more than once. The track positions reported are often inconsistent with each other.

 

A fair assumption is that playerStateDidChange would only be called when the playerState changes. This is not currently the case. Liking the currently playing song and enqueuing a song both emit playerStateDidChange.

 

In my opinion there is no reason to use the iOS SDK unless you are using this method. The Web API covers everything else a developer would need from the SDK. Unfortunately, if you are using playerStateDidChange for anything more complicated than a fun POC like the demo app, you are expected to write a decent amount of logic to throw away duplicate, unmarked events.

 

Please add event types to the exposure. The iOS SDK is overdue for an update.

Reply
0 Replies

Suggested posts