Instance Method


Returns a user token that you use to access personalized Apple Music content.


func requestUserToken(forDeveloperToken developerToken: String, completionHandler: @escaping (String?, Error?) -> Void)



A signed and encrypted JWT token used to authenticate the developer in Apple Music API requests.


A completion block that includes the following parameters:


A token that identifies the user.


The error that occurred, if any.


Use this method with your developer token to get a token that authenticates the user in personalized Apple Music API requests. Note that personalized requests return user-specific data. Errors 401 and 403 only occur when requesting a music user token. They do not occur for any of the other Apple Music API requests.

See Also

Determining Capabilities

func requestStorefrontCountryCode(completionHandler: (String?, Error?) -> Void)

Gets the country code for the storefront associated with a user's iTunes account.

func requestCapabilities(completionHandler: (SKCloudServiceCapability, Error?) -> Void)

Gets the current capabilities associated with the music library on the device.

struct SKCloudServiceCapability

Constants that specify the current capabilities of the user’s music library on the device.