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> delegateDeclared In
SPTAppRemoteUserAPI.h
– fetchCapabilitiesWithCallback:
required method
Fetches the current users capabilities from the Spotify app.
- (void)fetchCapabilitiesWithCallback:(nullable SPTAppRemoteCallback)callbackParameters
callback |
A callback block that will be invoked when the fetch request has completed.
On success |
|---|
Declared In
SPTAppRemoteUserAPI.h
– subscribeToCapabilityChanges:
required method
Subscribes to capability changes from the Spotify app.
- (void)subscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callbackParameters
callback |
A callback block that will be invoked when the subscription request has completed.
On success |
|---|
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)callbackParameters
callback |
A callback block that will be invoked when the unsubscription request has completed.
On success |
|---|
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)callbackParameters
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 |
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)callbackParameters
URI |
The URI of the item to save |
|---|---|
callback |
A callback block that will be invoked when the fetch request has completed.
On success |
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)callbackParameters
URI |
The URI of the item to remove |
|---|---|
callback |
A callback block that will be invoked when the fetch request has completed.
On success |
Declared In
SPTAppRemoteUserAPI.h