One Logo Pool Ball
MusicKit · IOS API REFERENCE

DefaultMusicTokenProvider

class · iOS 15.0+ · SDK 27.1

class DefaultMusicTokenProvider

The default token provider that music requests use to access Apple Music API.

Members (2)

method · iOS 15.0+

developerToken

TypeScript
developerToken(options: MusicTokenRequestOptions): Promise<string>
Swift declaration
func developerToken(options: MusicTokenRequestOptions) async throws -> String

Fetches and returns a developer token for Apple Music API. If you opt to create a custom implementation of the ``MusicDeveloperTokenProvider`` protocol, make sure to discard any cached developer token if the `options` parameter contains ``MusicTokenRequestOptions/ignoreCache``. You can add the newly generated token to an in-memory or persistent cache for faster access upon subsequent requests for this token.

init · iOS 15.0+

init

TypeScript
static init(): DefaultMusicTokenProvider
Swift declaration
override init()

Creates a user token provider.

Skipped declarations

No declarations were skipped in this snapshot.

All MusicKit types →