SPTConfiguration Class Reference

Inherits from NSObject
Conforms to NSSecureCoding
Declared in SPTConfiguration.h

Overview

A configuration class, holding the credentials provided for your app on the Spotify Developer website. See https://developer.spotify.com/my-applications/

Other Methods

  clientID

Your app’s Client ID from developer.spotify.com

@property (nonatomic, readonly, copy) NSString *clientID

Declared In

SPTConfiguration.h

  redirectURL

Your redirect URL. This is how the Spotify app will open your application after user authorization.

@property (nonatomic, readonly, copy) NSURL *redirectURL

Declared In

SPTConfiguration.h

  companyName

Your company name

@property (nonatomic, nullable, copy) NSString *companyName

Declared In

SPTConfiguration.h

– initWithClientID:redirectURL:

Designated initializer for SPTConfiguration

- (instancetype)initWithClientID:(NSString *)clientID redirectURL:(NSURL *)redirectURL

Parameters

clientID

Your client ID obtained from developer.spotify.com

redirectURL

Your redirect URL for Spotify to open your app again after authorization

Return Value

A newly initialized SPTConfiguration

Declared In

SPTConfiguration.h

+ configurationWithClientID:redirectURL:

Convenience intializer for SPTConfiguration

+ (instancetype)configurationWithClientID:(NSString *)clientID redirectURL:(NSURL *)redirectURL

Parameters

clientID

Your client ID obtained from developer.spotify.com

redirectURL

Your redirect URL for Spotify to open your app again after authorization

Return Value

A newly initialized SPTConfiguration

Declared In

SPTConfiguration.h

Other Methods

  tokenSwapURL

The URL to use for attempting to swap an authorization code for an access token. You should only set this if your clientID has a clientSecret and you have a backend service that holds the secret and can exchange the code and secret for an access token.

@property (nonatomic, nullable, copy) NSURL *tokenSwapURL

Declared In

SPTConfiguration.h

  tokenRefreshURL

The URL to use for attempting to renew an access token with a refresh token. You should only set this if your clientID has a clientSecret and you have a backend service that holds the secret and can use a refresh token to get a new access token.

@property (nonatomic, nullable, copy) NSURL *tokenRefreshURL

Declared In

SPTConfiguration.h

  playURI

If requesting the SPTAppRemoteControlScope you can provide an optional uri to begin playing after a successful authentication. To continue the user’s last session set this to a blank string @“”. If this value is nil or SPTAppRemoteControlScope is not requested no audio will play. If Spotify is already playing it will continue playing even though a URI is provided.

@property (nonatomic, nullable, copy) NSString *playURI

Declared In

SPTConfiguration.h