spotify / ios-sdk

Spotify SDK for iOS
https://developer.spotify.com/documentation/ios/
658 stars 186 forks source link

How to get player context? #57

Open rosseg opened 5 years ago

rosseg commented 5 years ago

The readme mentions that SPTAppRemotePlayerAPI allows you to request player context, but I can't find how to do this in the documentation or header file of SPTAppRemotePlayerAPI.

In the Android SDK docs https://spotify.github.io/android-sdk/app-remote-lib/docs/

there is a PlayerContext class, which represents the current context of the player - such as an album or a playlist - and its metadata.

jackfreeman commented 5 years ago

@rosseg you can now get a context title and URI from player state with the latest version of the SDK. https://spotify.github.io/ios-sdk/html/Protocols/SPTAppRemotePlayerState.html#//api/name/contextURI

rosseg commented 5 years ago

@jackfreeman So we will have to infer the context "type" from title and URI?

Side query: could you provide a list of context "type"s?