SPTAppRemoteUserAPI Protocol Reference

Conforms to NSObject
Declared in SPTAppRemoteUserAPI.h

Overview

The SPTAppRemoteUserAPI is used to get user data from, and interact with user features in, the Spotify app.

  delegate required method

The User API delegate gets notified whenever the API receives new data from subscription events.

@property (nonatomic, weak, readwrite) id<SPTAppRemoteUserAPIDelegate> delegate

Declared In

SPTAppRemoteUserAPI.h

– fetchCapabilitiesWithCallback: required method

Fetches the current users capabilities from the Spotify app.

- (void)fetchCapabilitiesWithCallback:(nullable SPTAppRemoteCallback)callback

Parameters

callback

A callback block that will be invoked when the fetch request has completed. On success result will be an instance of idSPTAppRemoteUserCapabilities. On error result will be nil and error will be set.

Declared In

SPTAppRemoteUserAPI.h

– subscribeToCapabilityChanges: required method

Subscribes to capability changes from the Spotify app.

- (void)subscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback

Parameters

callback

A callback block that will be invoked when the subscription request has completed. On success result will YES. On error result will be nil and error will be set.

Discussion

Note: Implement SPTAppRemoteUserAPIDelegate and set yourself as delegate in order to be notified when the the capabilities changes.

Declared In

SPTAppRemoteUserAPI.h

– unsubscribeToCapabilityChanges: required method

Stops subscribing to capability changes from the Spotify app.

- (void)unsubscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback

Parameters

callback

A callback block that will be invoked when the unsubscription request has completed. On success result will be YES. On error result will be nil and error will be set.

Declared In

SPTAppRemoteUserAPI.h

– fetchLibraryStateForURI:callback: required method

Fetches the current users library state for a given album or track uri.

- (void)fetchLibraryStateForURI:(NSString *)URI callback:(SPTAppRemoteCallback)callback

Parameters

URI

The URI of the album or track we are fetching the state for

callback

A callback block that will be invoked when the fetch request has completed. On success result will be an instance of idSPTAppRemoteLibraryState. On error result will be nil and error will be set.

Declared In

SPTAppRemoteUserAPI.h

– addItemToLibraryWithURI:callback: required method

Add item to the users library. Currently supported uris include: Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6

- (void)addItemToLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback

Parameters

URI

The URI of the item to save

callback

A callback block that will be invoked when the fetch request has completed. On success result will be an instance of idSPTAppRemoteLibraryState that indicates the resulting state of the entity. On error result will be nil and error will be set.

Declared In

SPTAppRemoteUserAPI.h

– removeItemFromLibraryWithURI:callback: required method

Remove item from users library. Currently supported uris include: Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6

- (void)removeItemFromLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback

Parameters

URI

The URI of the item to remove

callback

A callback block that will be invoked when the fetch request has completed. On success result will be an instance of idSPTAppRemoteLibraryState that indicates the resulting state of the entity. On error result will be nil and error will be set.

Declared In

SPTAppRemoteUserAPI.h