public interface UserApi
SpotifyAppRemote.getUserApi()
.SpotifyAppRemote
Modifier and Type | Method and Description |
---|---|
CallResult<Empty> |
addToLibrary(java.lang.String uri)
Adds item to users' library.
|
CallResult<Capabilities> |
getCapabilities()
Get the
Capabilities of a current user. |
CallResult<LibraryState> |
getLibraryState(java.lang.String uri)
Gets library state for the given Spotify uri.
|
CallResult<Empty> |
removeFromLibrary(java.lang.String uri)
Removes item from users library.
|
Subscription<Capabilities> |
subscribeToCapabilities()
Same as
getCapabilities() , but subscription. |
Subscription<UserStatus> |
subscribeToUserStatus() |
CallResult<Capabilities> getCapabilities()
Capabilities
of a current user. It is useful to call before you make call to
PlayerApi.play(String)
:
userApi.getCapabilities()
.setResultCallback( capabilities ->
if (capabilities.canPlayOnDemand) {
playerApi.play(trackUri);
} else {
// current user is not able to play on demand
}
)
Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
CallResult
with Capabilities
of a current userSubscription<Capabilities> subscribeToCapabilities()
getCapabilities()
, but subscription. Introduced in com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
Subscription
to Capabilities
of a current userSubscription<UserStatus> subscribeToUserStatus()
CallResult<Empty> addToLibrary(java.lang.String uri)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
uri
- to get saved state forCallResult<Empty> removeFromLibrary(java.lang.String uri)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
uri
- to get saved state forCallResult<LibraryState> getLibraryState(java.lang.String uri)
com.spotify.protocol.client.RequiredFeatures#FEATURES_V1
uri
- track or album to get library state forLibraryState
of a given uri.