SPTAppRemoteContentAPI Protocol Reference

Conforms to NSObject
Declared in SPTAppRemoteContentAPI.h

Overview

The SPTAppRemoteContentAPI is used to access content from the Spotify application.

– fetchRootContentItemsForType:callback: required method

Fetches the root level of content items for the current user.

- (void)fetchRootContentItemsForType:(SPTAppRemoteContentType)contentType callback:(nullable SPTAppRemoteCallback)callback

Parameters

contentType

A type that is used to retrieve content for a specific use-case.

callback

The callback to be called once the request is completed.

Discussion

Note: The content returned is based on the users' home feeds, and as such may vary between different users. If the user has no network connection or Spotify is forced offline, this method will return the user’s offline content, if any.

Deprecated. Use fetchRecommendedContentItemsForType:flattenContainers:callback: instead.

Declared In

SPTAppRemoteContentAPI.h

– fetchChildrenOfContentItem:callback: required method

Fetches the children items for the provided content item.

- (void)fetchChildrenOfContentItem:(id<SPTAppRemoteContentItem>)contentItem callback:(nullable SPTAppRemoteCallback)callback

Parameters

contentItem

The content item to fetch the children for.

callback

The callback to be called once the request is completed.

Discussion

Note: The isContainer property of the SPTAppRemoteContentItem indicates whether or not the item has any children.

Declared In

SPTAppRemoteContentAPI.h

– fetchRecommendedContentItemsForType:flattenContainers:callback: required method

Fetches a list of recommended playlists for the current user.

- (void)fetchRecommendedContentItemsForType:(SPTAppRemoteContentType)contentType flattenContainers:(BOOL)flattenContainers callback:(nullable SPTAppRemoteCallback)callback

Parameters

contentType

A type that is used to retrieve content for a specific use-case.

flattenContainers

Whether or not the recommendations should be flattened into a single list or remain separated in containers.

callback

The callback to be called once the request is completed.

Discussion

Note: The playlists returned are a mix of the user’s recently played feed as well as personal recommendations, and as such may vary between users. If the user is offline, this method will only return the content that is available offline, if any.

Note: This method is only supported by Spotify clients running version 8.4.75 and above and will fail with an SPTAppRemoteWAMPClientNotSupportedError otherwise.

Declared In

SPTAppRemoteContentAPI.h

– fetchContentItemForURI:callback: required method

Fetches the content item for the provided URI.

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

Parameters

URI

A Spotify URI as string

callback

The callback to be called once the request is completed.

Declared In

SPTAppRemoteContentAPI.h