Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Why are the iOS and Android SDK implementations of player context unnecessarily different?

Why are the iOS and Android SDK implementations of player context unnecessarily different?

With the Android SDK, there is no method to get the player context. There is, however, a subscribeToPlayerContext method for receiving changes to it with an event handler. This returns a PlayerContext object containing the title, subtitle, type, and uri of the player context. There is no player context information included with the PlayerState object.

 

With the iOS SDK, the player context is included with the PlayerState object. It can be retrived using either the getPlayerState method or by subscribing to player state changes. There is no such player context object or subscription as in Android. I think this is overall a better implementation but for some reason the subtitle and type are omitted, we only get the contextTitle and contextURI fields within the PlayerState.

 

Can we please have an update for the Android SDK to include the player context info along with the player state as it is in the iOS SDK? And also either include the subtitle and type in both, or neither. These differences in implementation make no sense and are making cross-platform app development more of a headache than it ought to be.

Reply
3 Replies

Hi,
I'm not entirely sure which info you try to receive. Is it possible top have multiple player contexts if several apps are connected to spotify?
Because if you just want the currently playing one the `track` Object in the `PlayerState` has much more info than the context values.

The context is different to the track. It is not information about the track, it is information about the context. The context describes what album, playlist, radio station, etc... the track is playing in.

 

I am not having any trouble obtaining this information. As I described in my post, I am able to get it.

 

My question is why the Android and iOS SDK have completely different implementations for no apparent reason. It is requiring me to have completely different logic in my android and iOS apps in order to process changes in context, which is impractical and unnecessary. 

 

I think this is something the SDK developers should consider changing. 

I see, I just learned something about the player context 🙂
I'm only using albums in my app so never stumbled on this problem.

Suggested posts