diff --git a/CHANGELOG.md b/CHANGELOG.md index 629b84f..dc494c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Spotify iOS SDK v2.1.2 +What's New: +- Dismiss authentication screen when Spotify app is installed. + ## Spotify iOS SDK v2.1.1 What's New: - Added the new campaign parameter in the sample apps. diff --git a/SpotifyiOS.framework/Headers b/SpotifyiOS.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/SpotifyiOS.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/SpotifyiOS.framework/Headers/SPTAppRemote.h b/SpotifyiOS.framework/Headers/SPTAppRemote.h deleted file mode 100644 index a758a79..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemote.h +++ /dev/null @@ -1,285 +0,0 @@ -#import - -@class SPTAppRemote; -@class SPTAppRemoteConnectionParams; -@class SPTConfiguration; - -@protocol SPTAppRemoteImageAPI; -@protocol SPTAppRemotePlayerAPI; -@protocol SPTAppRemoteUserAPI; -@protocol SPTAppRemoteContentAPI; -@protocol SPTAppRemoteConnectivityAPI; - -NS_ASSUME_NONNULL_BEGIN - -extern NSString * const SPTAppRemoteAccessTokenKey; -extern NSString * const SPTAppRemoteErrorKey; -extern NSString * const SPTAppRemoteErrorDescriptionKey; - -/// The severity of log messages that the App Remote should log to console. -typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) { - /// Do not log at all. - SPTAppRemoteLogLevelNone = 0, - /// Log debug, info and error messages. - SPTAppRemoteLogLevelDebug = 1, - /// Log info and error messages. - SPTAppRemoteLogLevelInfo = 2, - /// Log only error messages. - SPTAppRemoteLogLevelError = 3, -}; - -/** - * The `SPTAppRemoteDelegate` receives updates from the `SPTAppRemote` whenever something has - * happened with the connection. - */ -@protocol SPTAppRemoteDelegate - -/** - * Called when the App Remote has established connection with the Spotify app. - * - * @param appRemote The transport that has connected. - */ -- (void)appRemoteDidEstablishConnection:(SPTAppRemote *)appRemote; - -/** - * Called when the connection attempt made by the App Remote failed. - * - * @param appRemote The App Remote that failed to connect. - * @param error The error that occurred. - */ -- (void)appRemote:(SPTAppRemote *)appRemote didFailConnectionAttemptWithError:(nullable NSError *)error; - -/** - * Called when the App Remote has disconnected. - * - * @note All APIs will be released by the App Remote at this point. The will no longer be usable, - * and so you should release them as well. - * - * @param appRemote The App Remote that disconnected. - * @param error The error that caused the disconnect, or `nil` if the disconnect was explicit. - */ -- (void)appRemote:(SPTAppRemote *)appRemote didDisconnectWithError:(nullable NSError *)error; - -@end - -/** - * The `SPTAppRemote` is the main entry point for interacting with the Spotify app using the Spotify App Remote for iOS. - */ -@interface SPTAppRemote : NSObject - -#pragma mark Lifecycle - -/** - * Convenience Initializer for a new App Remote instance - * - * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs - * @param logLevel The lowest severity to log to console. - * - * @return A fresh new App Remote, ready to connect. - */ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration logLevel:(SPTAppRemoteLogLevel)logLevel; - -/** - * Designated Initializer for a new App Remote instance - * - * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs - * @param connectionParameters `SPTAppRemoteConnectionParams` for custom image sizes and types, and to hold the accessToken - * @param logLevel The lowest severity to log to console. - * - * @return A fresh new App Remote, ready to connect. - */ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration - connectionParameters:(SPTAppRemoteConnectionParams *)connectionParameters - logLevel:(SPTAppRemoteLogLevel)logLevel NS_DESIGNATED_INITIALIZER; -#pragma mark Class Methods - -/** - * Checks if the Spotify app is active on the user's device. You can use this to determine if maybe you should prompt - * the user to connect to Spotify (because you know they are already using Spotify if it is active). The Spotify app - * will be considered active if music is playing or the app is active in the background. - * - * @param completion Completion block for determining the result of the check. YES if Spotify is active, othewise NO. - */ -+ (void)checkIfSpotifyAppIsActive:(void (^)(BOOL active))completion; - -/** - * Determine the current version of the Spotify App Remote - * - * @return The current version of the Spotify App Remote - */ -+ (NSString *)appRemoteVersion; - -/** - * The Spotify app iTunes item identifier for use with `SKStoreProductViewController` for installing Spotify from the App Store. - * - * @return An `NSNumber` representing the Spotify iTunes item identifier to be used for the `SKStoreProductParameterITunesItemIdentifier` key - */ -+ (NSNumber *)spotifyItunesItemIdentifier; - -#pragma mark Connection - -/** - * The parameters to use during connection. - */ -@property (nonatomic, strong, readonly) SPTAppRemoteConnectionParams *connectionParameters; - -/** - * `YES` if the App Remote is connected to the Spotify application, otherwise `NO`. - * - * @note Not KVO’able. - * - * See The `SPTAppRemoteDelegate` in order to receive updates when the connection status changes. - */ -@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected; - -/** - * The delegate to notify for connection status changes and other events originating from the App Remote. - */ -@property (nonatomic, weak) id delegate; - -/** - * Attempts to connect to the Spotify application. - * - * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up - */ -- (void)connect; - -/** - * Attempts to connect to the Spotify application with a given session identifier. - * - * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up. - * - * @discussion If `authorizeAndPlayURI` was used without a given session identifier, `connect` should be used instead of this method. - * - * @param sessionIdentifier The unique session identifier which was used when calling - * `authorizeAndPlayURI:asRadio:additionalScopes:sessionIdentifier:` - */ -- (void)connectWithSessionIdentifier:(NSUUID *)sessionIdentifier; - -/** - * Disconnect from the Spotify application - */ -- (void)disconnect; - -/** - * Open Spotify app to obtain access token and start playback. - * The passed URI will start playing unless Spotify is already playing. - * - * @param URI The URI to play. Use a blank string to attempt to play the user's last song - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. - */ -- (void)authorizeAndPlayURI:(NSString *)URI completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** - * Open Spotify app to obtain access token and start playback. - * - * @param playURI The URI to play. Use a blank string to attempt to play the user's last song - * @param asRadio `YES` to start radio for the given URI. - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. - */ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** -* Open Spotify app to obtain access token and start playback. -* -* @param playURI The URI to play. Use a blank string to attempt to play the user's last song -* @param asRadio `YES` to start radio for the given URI. -* @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control` -* @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. -* -* Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if -* the Spotify app is installed and can attempt to handle the authorization request. -*/ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - additionalScopes:(nullable NSArray *)additionalScopes - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** - * Open Spotify app to obtain access token and start playback. - * - * @param playURI The URI to play. Use a blank string to attempt to play the user's last song - * @param asRadio `YES` to start radio for the given URI. - * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control` - * @param sessionIdentifier An optional unique identifier for this specific session, which is used for analytics purposes. Every new attempt to - * connect to the Spotify app should have a new identifier, but the identifier used here should then be reused for the accompanied call to - * `connectWithSessionIdentifier:`. - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. -*/ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - additionalScopes:(nullable NSArray *)additionalScopes - sessionIdentifier:(nullable NSUUID *)sessionIdentifier - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; -/** - * Parse out an access token or error description from a url passed to application:openURL:options: - * - * @param url The URL returned from the Spotify app after calling authorizeAndPlayURI - * - * @return A dictionary containing the access token or error description from the provided URL. - * Will return nil if the URL Scheme does not match the redirect URI provided. - * Use `SPTAppRemoteAccessTokenKey` and `SPTAppRemoteErrorDescriptionKey` to get the appropriate values. - */ -- (nullable NSDictionary *)authorizationParametersFromURL:(NSURL *)url; - -#pragma mark APIs - -/** - * The API used to control the Spotify player. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id playerAPI; - -/** - * The API used to fetch images from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id imageAPI; - -/** - * The API used to fetch user data from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id userAPI; - -/** - * The API used to fetch content from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id contentAPI; - -/** - * The API used to get connectivity data from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id connectivityAPI; - -#pragma mark Unavailable initializers - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h b/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h deleted file mode 100644 index 0d1b4fb..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteAlbum` represents an Album entity. - */ -@protocol SPTAppRemoteAlbum - -/// The name of the album. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the album. -@property (nonatomic, copy, readonly) NSString *URI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h b/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h deleted file mode 100644 index 52f34f2..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteArtist` represents an artist. - */ -@protocol SPTAppRemoteArtist - -/// The name of the artist. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the artist. -@property (nonatomic, copy, readonly) NSString *URI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h b/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h deleted file mode 100644 index 1bf43b5..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Common header definitions - */ - -NS_ASSUME_NONNULL_BEGIN - -/// The error domain for user facing errors that occur in the App Remote. -extern NSString * const SPTAppRemoteErrorDomain; - -/// The error codes in the `SPTAppRemoteErrorDomain` domain. -typedef NS_ENUM(NSInteger, SPTAppRemoteErrorCode) { - /// An unknown error. - SPTAppRemoteUnknownError = -1, - - /// The background wakeup of the Spotify app failed. - SPTAppRemoteBackgroundWakeupFailedError = -1000, - /// The connection attempt to the Spotify app failed. - SPTAppRemoteConnectionAttemptFailedError = -1001, - /// The conncetion to the Spotify app was terminated. - SPTAppRemoteConnectionTerminatedError = -1002, - /// The arguments supplied are invalid. - SPTAppRemoteInvalidArgumentsError = -2000, - /// The request has failed for some reason. - SPTAppRemoteRequestFailedError = -2001, -}; - -/** - * A callback block used by many App Remote API methods. - * - * @param result The result of the operation, or `nil` if the operation failed. - * @param error An error object, or `nil` if the operation was a success. - */ -typedef void (^SPTAppRemoteCallback)(id _Nullable result, NSError * _Nullable error); - -NS_ASSUME_NONNULL_END - diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h b/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h deleted file mode 100644 index 808708f..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +++ /dev/null @@ -1,65 +0,0 @@ -#import - -/// Available image formats to receive from the Spotify app. -typedef NS_ENUM(NSUInteger, SPTAppRemoteConnectionParamsImageFormat) { - /// Any image format is acceptable. Use this if you don't care about which image format is sent. - SPTAppRemoteConnectionParamsImageFormatAny = 0, - /// JPEG image format. - SPTAppRemoteConnectionParamsImageFormatJPEG, - /// PNG image format. - SPTAppRemoteConnectionParamsImageFormatPNG, -}; - -struct CGSize; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteconnectionParams` represents connection parameters required in order to initiate a connection - * with the Spotify app. - */ -@interface SPTAppRemoteConnectionParams : NSObject - -/// The access token used to authorize the user with the Spotify app. -@property (nonatomic, copy, readwrite, nullable) NSString *accessToken; - -/// The desired size of received images. (0,0) acts as a wildcard and accepts any size. -@property (nonatomic, assign, readonly) struct CGSize defaultImageSize; - -/// The desired image format of received images. -@property (nonatomic, assign, readonly) SPTAppRemoteConnectionParamsImageFormat imageFormat; - -/** - * Initialize a set of new connection parameters. - * - * @discussion This is the designated initializer. - * - * @param accessToken The access token obtained after authentication. - * @param defaultImageSize The desired size of received images. (0,0) acts as a wildcard and accepts any size. - * @param imageFormat The desired image format of received images. - * - * @return A set of connection parameters ready to be used when initiating a connection to the Spotify app. - */ -- (instancetype)initWithAccessToken:(nullable NSString *)accessToken - defaultImageSize:(struct CGSize)defaultImageSize - imageFormat:(SPTAppRemoteConnectionParamsImageFormat)imageFormat NS_DESIGNATED_INITIALIZER; - -#pragma mark Static properties - -/// Version of the protocol -@property (nonatomic, assign, readonly) NSInteger protocolVersion; - -/// Roles -@property (nonatomic, copy, readonly) NSDictionary *roles; - -/// Authentication methods supported -@property (nonatomic, copy, readonly) NSArray *authenticationMethods; - -#pragma mark Unavailable initializers - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h b/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h deleted file mode 100644 index dbc6792..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h +++ /dev/null @@ -1,54 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" - -@protocol SPTAppRemoteConnectivityAPI; -@protocol SPTAppRemoteConnectivityState; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteConnectivityAPIDelegate` gets notified whenever the connectivity API receives new data from subscription events. - */ -@protocol SPTAppRemoteConnectivityAPIDelegate - -/** - * Called when the connectivity state has been updated. - * - * @param connectivityAPI The API that received updates. - * @param connectivityState The new connectivity state received. - */ -- (void)connectivityAPI:(id)connectivityAPI didReceiveNewConnectivityState:(id)connectivityState; - -@end - -/** - The @c SPTAppRemoteConnectivityAPI class is used to get connectivity data from the Spotify app. - */ -@protocol SPTAppRemoteConnectivityAPI - -/// The delegate receiving player state updates -@property (nonatomic, weak) id delegate; - -/** - * Subscribes to connection state changes from the Spotify app. - * - * @note Implement `SPTAppRemoteConnectivityAPIDelegate` and set yourself as delegate in order to be notified when the - * the connection state changes. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)subscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to connection state changes from the Spotify app. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)unsubscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h b/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h deleted file mode 100644 index 047b340..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - The @c SPTAppRemoteConnectivityState class represents the online/offline state of the Spotify app. - */ -@protocol SPTAppRemoteConnectivityState - -/// Whether the Spotify app is offline or not. -@property (nonatomic, readonly, getter=isOffline) BOOL offline; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h b/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h deleted file mode 100644 index 82843e4..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +++ /dev/null @@ -1,76 +0,0 @@ -#import -#import "SPTAppRemoteCommon.h" - -NS_ASSUME_NONNULL_BEGIN - -/// A type representing different lists of content. -typedef NSString * const SPTAppRemoteContentType; - -extern NSString * const SPTAppRemoteContentTypeDefault; -extern NSString * const SPTAppRemoteContentTypeNavigation; -extern NSString * const SPTAppRemoteContentTypeFitness; -extern NSString * const SPTAppRemoteContentTypeGaming; - -@protocol SPTAppRemoteContentItem; - -/** - * The `SPTAppRemoteContentAPI` is used to access content from the Spotify application. - */ -@protocol SPTAppRemoteContentAPI - -/** - * Fetches the root level of content items for the current user. - * - * @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. - * - * @param contentType A type that is used to retrieve content for a specific use-case. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchRootContentItemsForType:(SPTAppRemoteContentType)contentType - callback:(nullable SPTAppRemoteCallback)callback DEPRECATED_MSG_ATTRIBUTE("Deprecated. Use fetchRecommendedContentItemsForType:flattenContainers:callback: instead."); - -/** - * Fetches the children items for the provided content item. - * - * @note The `isContainer` property of the `SPTAppRemoteContentItem` - * indicates whether or not the item has any children. - * - * @param contentItem The content item to fetch the children for. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchChildrenOfContentItem:(id)contentItem - callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Fetches a list of recommended playlists for the current user. - * - * @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. - * - * @param contentType A type that is used to retrieve content for a specific use-case. - * @param flattenContainers Whether or not the recommendations should be flattened into a single list or remain - * separated in containers. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchRecommendedContentItemsForType:(SPTAppRemoteContentType)contentType - flattenContainers:(BOOL)flattenContainers - callback:(nullable SPTAppRemoteCallback)callback; - -/** - Fetches the content item for the provided URI. - - @param URI A Spotify URI as string - @param callback The callback to be called once the request is completed. - */ -- (void)fetchContentItemForURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h b/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h deleted file mode 100644 index a1d5b42..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +++ /dev/null @@ -1,49 +0,0 @@ -#import -#import "SPTAppRemoteImageRepresentable.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteContentItem` protocol represents a track or a collection of tracks. Use the `isContainer` instance method - * to determine if the content item is a collection of tracks for which to grab children from. - */ -@protocol SPTAppRemoteContentItem - -/// The primary title of the item. -@property (nonatomic, copy, readonly, nullable) NSString *title; - -/// The secondary title of the item. -@property (nonatomic, copy, readonly, nullable) NSString *subtitle; - -/// The description of the item. -@property (nonatomic, copy, readonly, nullable) NSString *contentDescription; - -/// The unique identifier of the item. -@property (nonatomic, copy, readonly) NSString *identifier; - -/// The playback URI of this item. -@property (nonatomic, copy, readonly) NSString *URI; - -/// `YES` if the item is available offline, or if it has any child that is available offline, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isAvailableOffline) BOOL availableOffline; - -/// Returns `YES` if the item is directly playable, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isPlayable) BOOL playable; - -/// Returns `YES` if the item is expected to contain children, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isContainer) BOOL container; - -/// Returns `YES` if the item is pinned in Your Library, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isPinned) BOOL pinnned; - -/** - A list of the content item's children. - - @note This is not populated for all container items as some of them are fetched - lazily with the `fetchChildrenOfContentItem:callback:` method. - */ -@property (nonatomic, strong, readonly, nullable) NSArray> *children; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h b/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h deleted file mode 100644 index c59c4b0..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteCrossfadeState` represents the state of crossfade. - */ -@protocol SPTAppRemoteCrossfadeState - -/// The on/off state of crossfade. -@property (nonatomic, readonly, getter=isEnabled) BOOL enabled; - -/// The duration of crossfade in milliseconds. The value is meaningless if crossfade is not enabled. -@property (nonatomic, readonly) NSInteger duration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h b/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h deleted file mode 100644 index 75e8e75..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +++ /dev/null @@ -1,25 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" -#import "SPTAppRemoteImageRepresentable.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * API for fetching image data from the Spotify app - */ -@protocol SPTAppRemoteImageAPI - -/** - * Fetch an image with the given ID from the Spotify app. - * - * @param imageRepresentable The item containing the ID of the image to fetch. - * @param imageSize The size of the image to fetch. - * @param callback On success `result` will be an instance of `UIImage` - * On error `result` will be nil and error set - */ -- (void)fetchImageForItem:(id)imageRepresentable withSize:(CGSize)imageSize callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h b/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h deleted file mode 100644 index 656347e..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +++ /dev/null @@ -1,16 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTImageRepresentable` protocol represents an object that may contain an image. - * If something conforms to this protocol you can pass it to `SPTAppRemoteImageAPI` fetchImageForItem: method. - */ -@protocol SPTAppRemoteImageRepresentable - -/// The identifier of the image of the entity. -@property (nonatomic, strong, readonly) NSString *imageIdentifier; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h b/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h deleted file mode 100644 index 7a44c1c..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +++ /dev/null @@ -1,19 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteLibraryState` represents a the state of an album or track in a users Spotify library. - */ -@protocol SPTAppRemoteLibraryState - -/// The uri of the track or album -@property (nonatomic, strong, readonly) NSString *uri; -/// `YES` album or track was added to the user's library, otherwise `NO`. -@property (nonatomic, assign, readonly) BOOL isAdded; -/// `YES` album or track can be added to the user's library, otherwise `NO`. -@property (nonatomic, assign, readonly) BOOL canAdd; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h b/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h deleted file mode 100644 index 4135d73..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/// The available repeat modes. -typedef NS_ENUM(NSUInteger, SPTAppRemotePlaybackOptionsRepeatMode) { - /// Repeat is off. - SPTAppRemotePlaybackOptionsRepeatModeOff = 0, - - /// Repeats the current track. - SPTAppRemotePlaybackOptionsRepeatModeTrack = 1, - - /// Repeats the current context. - SPTAppRemotePlaybackOptionsRepeatModeContext = 2, -}; - -/** - * The `SPTAppRemotePlaybackOptions` describes a set of options used for the current playback. - * - * @discussion Use these to determine UI states. - */ -@protocol SPTAppRemotePlaybackOptions - -/// `YES` if shuffle is enabled, otherwise `NO`. -@property (nonatomic, readonly) BOOL isShuffling; - -/// The current repeat mode in effect. -@property (nonatomic, readonly) SPTAppRemotePlaybackOptionsRepeatMode repeatMode; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h b/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h deleted file mode 100644 index 8b5c6b0..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlaybackRestrictions` describes a set of restrictions for playback in the Spotify client. - * - * @discussion Use these to determine whether to enable or disable certain actions in the UI. - */ -@protocol SPTAppRemotePlaybackRestrictions - -/// `YES` if the user can skip to the next track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSkipNext; - -/// `YES` if the user can skip to the previous track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSkipPrevious; - -/// `YES` if the user can repeat the current track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canRepeatTrack; - -/// `YES` if the user can repeat the current context, otherwise `NO`. -@property (nonatomic, readonly) BOOL canRepeatContext; - -/// `YES` if the user can toggle shuffle, otherwise `NO`. -@property (nonatomic, readonly) BOOL canToggleShuffle; - -/// `YES` if the user can seek to specific positions, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSeek; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h b/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h deleted file mode 100644 index d202ffb..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +++ /dev/null @@ -1,262 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" -#import "SPTAppRemotePlaybackOptions.h" - -@protocol SPTAppRemotePlayerState, SPTAppRemoteContentItem, SPTAppRemotePodcastPlaybackSpeed; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlayerStateDelegate` is used to get notifications from the Spotify app when the player state is changed. - */ -@protocol SPTAppRemotePlayerStateDelegate - -/** - * Called when the player state has been updated. - * - * @param playerState The new player state. - */ -- (void)playerStateDidChange:(id)playerState; - -@end - -/** - * The `SPTAppRemotePlayerAPI` is used to interact with and control the Spotify player. - */ -@protocol SPTAppRemotePlayerAPI - -/// The delegate receiving player state updates -@property (nonatomic, weak) id delegate; - -#pragma mark Player Control - -/** - * Asks the Spotify player to play the entity with the given identifier. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * - * @param entityIdentifier The unique identifier of the entity to play. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)play:(NSString *)entityIdentifier callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the entity with the given identifier. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * - * @param trackUri The track URI to play. - * @param asRadio `YES` to start radio for track URI. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)play:(NSString *)trackUri asRadio:(BOOL)asRadio callback:(SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the provided content item. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is - * playable. - * - * @param contentItem The content item to play. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)playItem:(id)contentItem callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the provided content item starting at the specified index. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is - * playable. - * @note Sending an `index` parameter that is out of bounds is undefined. - * - * @param contentItem The content item to play. - * @param index The index of the track to skip to if applicable. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)playItem:(id)contentItem skipToTrackIndex:(NSInteger) index callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to resume playback. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the playback resumes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be nil and error set - */ -- (void)resume:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to pause playback. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the playback pauses. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)pause:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to skip to the next track. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track changes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)skipToNext:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to skip to the previous track. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track changes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)skipToPrevious:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek to the specified position. - * - * @param position The position to seek to in milliseconds. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekToPosition:(NSInteger)position callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek forward 15 seconds. - * Note: You should only use this method if isEpisode = YES for the currently playing track - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekForward15Seconds:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek backward 15 seconds. - * Note: You should only use this method if isEpisode = YES for the currently playing track - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekBackward15Seconds:(nullable SPTAppRemoteCallback)callback; - -#pragma mark Playback Options - -/** - * Asks the Spotify player to set shuffle mode. - * - * @param shuffle `YES` to enable shuffle, `NO` to disable. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)setShuffle:(BOOL)shuffle callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to set the repeat mode. - * - * @param repeatMode The repeat mode to set. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)setRepeatMode:(SPTAppRemotePlaybackOptionsRepeatMode)repeatMode callback:(nullable SPTAppRemoteCallback)callback; - -#pragma mark Player State - -/** - * Asks the Spotify player for the current player state. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)getPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Subscribes to player state changes from the Spotify app. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the player state changes. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)subscribeToPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to player state changes from the Spotify app. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)unsubscribeToPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Adds a track to the user's currently playing queue - * - * @param trackUri The track URI to add to the queue - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)enqueueTrackUri:(NSString*)trackUri callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for available podcast playback speeds - * - * @param callback On success `result` will be an `NSArray` of `SPTAppRemotePodcastPlaybackSpeed` objects - * On error `result` will be `nil` and `error` set - */ -- (void)getAvailablePodcastPlaybackSpeeds:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for the current podcast playback speed - * - * @note Podcast playback speed is seperate from other contents' playback speed. This value is only used for podcasts - * - * @param callback On success `result` will be a `SPTAppRemotePodcastPlaybackSpeed` - * On error `result` will be `nil` and `error` set - */ -- (void)getCurrentPodcastPlaybackSpeed:(nullable SPTAppRemoteCallback)callback; - -/** - * Set the current podcast playback speed - * - * @note This playback speed will only affect podcasts and not other types of media. If you set this - * when a podcast is not playing this will be the default value when a podcast does begin to play. For this reason - * you may get a successful callback when setting this even when a podcast is not playing and the current playback - * speed does not change. - * - * @note You should use `getAvailablePodcastPlaybackSpeeds:` to get a list of valid speeds to pass to this method - * - * @param speed The `SPTAppRemotePodcastPlaybackSpeed` to set as the current podcast playback speed - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)setPodcastPlaybackSpeed:(nonnull id)speed callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for the current crossfade state. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)getCrossfadeState:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h b/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h deleted file mode 100644 index 4b2305d..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +++ /dev/null @@ -1,40 +0,0 @@ -#import - -@protocol SPTAppRemoteTrack; -@protocol SPTAppRemotePlaybackOptions; -@protocol SPTAppRemotePlaybackRestrictions; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlayerState` represents the state within the Spotify player. - */ -@protocol SPTAppRemotePlayerState - -/// The track being played in the Spotify player. -@property (nonatomic, readonly) id track; - -/// The position of the playback in the Spotify player. -@property (nonatomic, readonly) NSInteger playbackPosition; - -/// The speed of the playback in the Spotify player. -@property (nonatomic, readonly) float playbackSpeed; - -/// `YES` if the Spotify player is paused, otherwise `NO`. -@property (nonatomic, readonly, getter=isPaused) BOOL paused; - -/// The playback restrictions currently in effect. -@property (nonatomic, readonly) id playbackRestrictions; - -/// The playback options currently in effect. -@property (nonatomic, readonly) id playbackOptions; - -/// The title of the currently playing context (e.g. the name of the playlist). -@property (nonatomic, readonly) NSString *contextTitle; - -/// The URI of the currently playing context (e.g. the URI of the playlist). -@property (nonatomic, readonly) NSURL *contextURI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h b/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h deleted file mode 100644 index 90113a2..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePodcastPlaybackSpeed` represents playback speed(s) for podcasts - */ -@protocol SPTAppRemotePodcastPlaybackSpeed - -/// The speed multiplier representing this podcast speed. 0.5 = half speed, 2 = twice as fast, 1 = normal playback -@property (nonatomic, strong, readonly) NSNumber *value; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h b/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h deleted file mode 100644 index f9de56e..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +++ /dev/null @@ -1,52 +0,0 @@ -#import "SPTAppRemoteImageRepresentable.h" - -@protocol SPTAppRemoteAlbum; -@protocol SPTAppRemoteArtist; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteTrack` represents a track. - */ -@protocol SPTAppRemoteTrack - -/// The name of the track. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the track. -@property (nonatomic, copy, readonly) NSString *URI; - -/// The duration of the track in miliseconds. -@property (nonatomic, assign, readonly) NSUInteger duration; - -/// The artist of the track. -@property (nonatomic, strong, readonly) id artist; - -/// The album of the track. -@property (nonatomic, strong, readonly) id album; - -/// `YES` if the user has saved the track, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isSaved) BOOL saved; - -/** - * `YES` if the track is a podcast, video, or other audio episode, otherwise `NO`. - * If the track is an episode and `SPTAppRemotePlaybackRestrictions` `canSeek` is `YES` you should show - * 15 second skip buttons in your UI. - */ -@property (nonatomic, assign, readonly, getter=isEpisode) BOOL episode; - -/** - * `YES` if the track is a podcast, otherwise `NO`. - * If the track is a podcast and `SPTAppRemotePlaybackRestrictions` `canSeek` is `YES` you should show - * 15 second skip buttons in your UI as well as a podcast speed control to change playback speed. - */ -@property (nonatomic, assign, readonly, getter=isPodcast) BOOL podcast; - -/** - * `YES` if the track is an ad, otherwise `NO`. - */ -@property (nonatomic, assign, readonly, getter=isAdvertisement) BOOL advertisement; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h b/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h deleted file mode 100644 index 79ee075..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +++ /dev/null @@ -1,103 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" - -@protocol SPTAppRemoteUserAPI; -@protocol SPTAppRemoteUserCapabilities; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteUserAPIDelegate` gets notified whenever the user API receives new data from subscription events. - */ -@protocol SPTAppRemoteUserAPIDelegate - -/** - * Called when the capabilities has been updated. - * - * @note This will only be called if there is an active capabilities subscription. - * - * @param userAPI The API that received updates. - * @param capabilities The new capabilities that was received. - */ -- (void)userAPI:(id)userAPI didReceiveCapabilities:(id)capabilities; - -@end - -/** - * The `SPTAppRemoteUserAPI` is used to get user data from, and interact with user features in, the Spotify app. - */ -@protocol SPTAppRemoteUserAPI - -/// The User API delegate gets notified whenever the API receives new data from subscription events. -@property (nonatomic, weak, readwrite) id delegate; - -/** - * Fetches the current users capabilities from the Spotify app. - * - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)fetchCapabilitiesWithCallback:(nullable SPTAppRemoteCallback)callback; - -/** - * Subscribes to capability changes from the Spotify app. - * - * @note Implement `SPTAppRemoteUserAPIDelegate` and set yourself as `delegate` in order to be notified when the - * the capabilities changes. - * - * @param callback A callback block that will be invoked when the subscription request has completed. - * On success `result` will `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)subscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to capability changes from the Spotify app. - * - * @param callback A callback block that will be invoked when the unsubscription request has completed. - * On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)unsubscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback; - -/** - * Fetches the current users library state for a given album or track uri. - * - * @param URI The URI of the album or track we are fetching the state for - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)fetchLibraryStateForURI:(NSString *)URI callback:(SPTAppRemoteCallback)callback; - -/** - * Add item to the users library. - * Currently supported uris include: - * Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 - * Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6 - * - * @param URI The URI of the item to save - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id` that indicates the resulting state of the entity. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)addItemToLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Remove item from users library. - * Currently supported uris include: - * Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 - * Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6 - * - * @param URI The URI of the item to remove - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id` that indicates the resulting state of the entity. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)removeItemFromLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h b/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h deleted file mode 100644 index 0dde3e6..0000000 --- a/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteUserCapabilities` represents a set of capabilities the current user has in the Spotify app. - */ -@protocol SPTAppRemoteUserCapabilities - -/// `YES` if the user can play songs on demand, otherwise `NO`. This will differ for premium and non-premium users -@property (nonatomic, assign, readonly) BOOL canPlayOnDemand; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTConfiguration.h b/SpotifyiOS.framework/Headers/SPTConfiguration.h deleted file mode 100644 index 3a0f681..0000000 --- a/SpotifyiOS.framework/Headers/SPTConfiguration.h +++ /dev/null @@ -1,66 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - A configuration class, holding the credentials provided for your app on the Spotify Developer website. - See https://developer.spotify.com/my-applications/ -*/ -@interface SPTConfiguration : NSObject - -/// Your app's Client ID from developer.spotify.com -@property (nonatomic, readonly, copy) NSString *clientID; - -/// Your redirect URL. This is how the Spotify app will open your application after user authorization. -@property (nonatomic, readonly, copy) NSURL *redirectURL; - -/// Name of the company -@property (nonatomic, nullable, copy) NSString *companyName; - -/** - 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; - -/** - 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; - -/** - 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; - -- (instancetype)init NS_UNAVAILABLE; - -/** - Designated initializer for `SPTConfiguration` - - @param clientID Your client ID obtained from developer.spotify.com - @param redirectURL Your redirect URL for Spotify to open your app again after authorization - @return A newly initialized `SPTConfiguration` - */ -- (instancetype)initWithClientID:(NSString *)clientID - redirectURL:(NSURL *)redirectURL NS_DESIGNATED_INITIALIZER; - -/** - Convenience intializer for `SPtConfiguration` - - @param clientID Your client ID obtained from developer.spotify.com - @param redirectURL Your redirect URL for Spotify to open your app again after authorization - @return A newly initialized `SPTConfiguration` - */ -+ (instancetype)configurationWithClientID:(NSString *)clientID - redirectURL:(NSURL *)redirectURL NS_SWIFT_UNAVAILABLE("superfluous"); - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTError.h b/SpotifyiOS.framework/Headers/SPTError.h deleted file mode 100644 index a470cd1..0000000 --- a/SpotifyiOS.framework/Headers/SPTError.h +++ /dev/null @@ -1,33 +0,0 @@ -#import - -#import "SPTMacros.h" - -NS_ASSUME_NONNULL_BEGIN - -SPT_EXPORT NSErrorDomain const SPTLoginErrorDomain; - -/// Spotify error codes, use NSUnderlyingErrorKey to see the underlying error -typedef NS_ENUM(NSUInteger, SPTErrorCode) -{ - /// Unknown error code - SPTUnknownErrorCode NS_SWIFT_NAME(unknown) = 0, - /// Authorization failed - SPTAuthorizationFailedErrorCode NS_SWIFT_NAME(authorizationFailed), - /// Renew session failed - SPTRenewSessionFailedErrorCode NS_SWIFT_NAME(renewSessionFailed), - /// Failed to parse the returned JSON - SPTJSONFailedErrorCode NS_SWIFT_NAME(jsonFailed), -}; - -/// Spotify-specific errors. Use NSUnderlyingErrorKey to see the underlying error -@interface SPTError : NSError - -+ (instancetype)errorWithCode:(SPTErrorCode)code; - -+ (instancetype)errorWithCode:(SPTErrorCode)code description:(NSString *)description; - -+ (instancetype)errorWithCode:(SPTErrorCode)code underlyingError:(NSError *)error; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTLogin.h b/SpotifyiOS.framework/Headers/SPTLogin.h deleted file mode 100644 index 611b76a..0000000 --- a/SpotifyiOS.framework/Headers/SPTLogin.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _SPOTIFYLOGIN_ -#define _SPOTIFYLOGIN_ - -#import "SPTConfiguration.h" -#import "SPTError.h" -#import "SPTScope.h" -#import "SPTSession.h" -#import "SPTSessionManager.h" - -#endif /* _SPOTIFYLOGIN_ */ diff --git a/SpotifyiOS.framework/Headers/SPTMacros.h b/SpotifyiOS.framework/Headers/SPTMacros.h deleted file mode 100644 index c7b5415..0000000 --- a/SpotifyiOS.framework/Headers/SPTMacros.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef SPT_MACROS -#define SPT_MACROS - -#ifdef __cplusplus -#define SPT_EXPORT extern "C" __attribute__((visibility("default"))) -#else -#define SPT_EXPORT extern __attribute__((visibility("default"))) -#endif // __cplusplus - -#define SPT_DEPRECATED(MESSAGE) __attribute__((deprecated(MESSAGE))) -#define SPT_UNAVAILABLE __attribute__((unavailable)) -#define SPT_UNUSED __attribute__((unused)) -#define SPT_UNREACHABLE() __builtin_unreachable() - -#define SPT_INLINE __attribute__((always_inline)) inline -#define SPT_CONST __attribute__((const)) -#define SPT_PURE __attribute__((pure)) - -#define SPT_NONNULL __attribute__((nonnull)) -#define SPT_RETURNS_NONNULL __attribute__((returns_nonnull)) - -#define SPT_EXPECT(EXPR, VAL) __builtin_expect(!!(EXPR), VAL) -#define SPT_LIKELY(EXPR) SPT_EXPECT(EXPR, 1) -#define SPT_UNLIKELY(EXPR) SPT_EXPECT(EXPR, 0) - -#define SPT_MAX_POW2(TYPE_MAX) ((TYPE_MAX >> 1) ^ TYPE_MAX) - -#define SPT_EXPR_OR_ZERO(EXPR) __builtin_choose_expr(SPT_TYPE_IS_VOID(EXPR), 0, (EXPR)) -#define SPT_TYPE_IS_VOID(EXPR) __builtin_types_compatible_p(typeof(EXPR), void) - -/** - Check if the receiver responds to a selector, then send the message, - along with the provided parameters. - - The purpose of this macro, other than to make code less cluttered, is to make - it impossible to accidentally check for a selector but send a different message. - - @param RECEIVER The object to which the message will be sent. - @param RESULT[out] A pointer to which the return value will be assigned. - @param ... 0-4 arguments. - \code{.m} - BOOL result = NO; - SPT_OPTIONAL_MESSAGE_SEND(self.delegate, &result, someThingie, self, didSomethingWith, someObject); - // Expands to the following: - do { - if ([self.delegate respondsToSelector:@selector(someThingie:didSomethingWith:)]) - *(result) = [self.delegate someThingie:self didSomethingWith:someObject)]; - } while (0); - \endcode -*/ -#define SPT_OPTIONAL_MESSAGE_SEND(RECEIVER, RESULT, ...) do { \ - if ([RECEIVER respondsToSelector:@selector(SPT_CONCAT_SELECTOR(__VA_ARGS__))]) \ - *(RESULT) = [RECEIVER SPT_CONCAT_METHOD(__VA_ARGS__)]; \ -} while (0) - -/** - Like SPT_OPTIONAL_MESSAGE_SEND but ignores the return value. - @param RECEIVER The object to which the message will be sent. - @param ... 0-4 arguments. -*/ -#define SPT_OPTIONAL_MESSAGE_SEND_(RECEIVER, ...) do { \ - if ([RECEIVER respondsToSelector:@selector(SPT_CONCAT_SELECTOR(__VA_ARGS__))]) \ - [RECEIVER SPT_CONCAT_METHOD(__VA_ARGS__)]; \ -} while (0) - -// Some boilerplate for SPT_OPTIONAL_MESSAGE_SEND[_] -#define SPT_CONCAT_METHOD8(A, _1, B, _2, C, _3, D, _4) A:_1 B:_2 C:_3 D:_4 -#define SPT_CONCAT_METHOD6(A, _1, B, _2, C, _3) A:_1 B:_2 C:_3 -#define SPT_CONCAT_METHOD4(A, _1, B, _2) A:_1 B:_2 -#define SPT_CONCAT_METHOD2(A, _1) A:_1 -#define SPT_CONCAT_METHOD1(A) A - -#define SPT_CONCAT_SELECTOR8(A, _1, B, _2, C, _3, D, _4) A:B:C:D: -#define SPT_CONCAT_SELECTOR6(A, _1, B, _2, C, _3) A:B:C: -#define SPT_CONCAT_SELECTOR4(A, _1, B, _2) A:B: -#define SPT_CONCAT_SELECTOR2(A, _1) A: -#define SPT_CONCAT_SELECTOR1(A) A - -#define SPT_PICK_CONCAT_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, NAME, ...) NAME - -#define SPT_CONCAT_METHOD(...) SPT_PICK_CONCAT_MACRO(__VA_ARGS__, \ - SPT_CONCAT_METHOD8, SPT_CONCAT_METHOD7, SPT_CONCAT_METHOD6, SPT_CONCAT_METHOD5, \ - SPT_CONCAT_METHOD4, SPT_CONCAT_METHOD3, SPT_CONCAT_METHOD2, SPT_CONCAT_METHOD1)(__VA_ARGS__) - -#define SPT_CONCAT_SELECTOR(...) SPT_PICK_CONCAT_MACRO(__VA_ARGS__, \ - SPT_CONCAT_SELECTOR8, SPT_CONCAT_SELECTOR7, SPT_CONCAT_SELECTOR6, SPT_CONCAT_SELECTOR5, \ - SPT_CONCAT_SELECTOR4, SPT_CONCAT_SELECTOR3, SPT_CONCAT_SELECTOR2, SPT_CONCAT_SELECTOR1)(__VA_ARGS__) - -#endif // SPT_MACROS diff --git a/SpotifyiOS.framework/Headers/SPTScope.h b/SpotifyiOS.framework/Headers/SPTScope.h deleted file mode 100644 index 2712de7..0000000 --- a/SpotifyiOS.framework/Headers/SPTScope.h +++ /dev/null @@ -1,71 +0,0 @@ -// (Objective-C identifier, Swift name, string value, bit flag) -#define SPT_SCOPE_LIST \ -SPT_SCOPE(SPTPlaylistReadPrivateScope, playlistReadPrivate, "playlist-read-private", (1 << 0)) \ -SPT_SCOPE(SPTPlaylistReadCollaborativeScope, playlistReadCollaborative, "playlist-read-collaborative", (1 << 1)) \ -SPT_SCOPE(SPTPlaylistModifyPublicScope, playlistModifyPublic, "playlist-modify-public", (1 << 2)) \ -SPT_SCOPE(SPTPlaylistModifyPrivateScope, playlistModifyPrivate, "playlist-modify-private", (1 << 3)) \ -SPT_SCOPE(SPTUserFollowReadScope, userFollowRead, "user-follow-read", (1 << 4)) \ -SPT_SCOPE(SPTUserFollowModifyScope, userFollowModify, "user-follow-modify", (1 << 5)) \ -SPT_SCOPE(SPTUserLibraryReadScope, userLibraryRead, "user-library-read", (1 << 6)) \ -SPT_SCOPE(SPTUserLibraryModifyScope, userLibraryModify, "user-library-modify", (1 << 7)) \ -SPT_SCOPE(SPTUserReadBirthDateScope, userReadBirthDate, "user-read-birthdate", (1 << 8)) \ -SPT_SCOPE(SPTUserReadEmailScope, userReadEmail, "user-read-email", (1 << 9)) \ -SPT_SCOPE(SPTUserReadPrivateScope, userReadPrivate, "user-read-private", (1 << 10)) \ -SPT_SCOPE(SPTUserTopReadScope, userTopRead, "user-top-read", (1 << 11)) \ -SPT_SCOPE(SPTUGCImageUploadScope, ugcImageUpload, "ugc-image-upload", (1 << 12)) \ -SPT_SCOPE(SPTStreamingScope, streaming, "streaming", (1 << 13)) \ -SPT_SCOPE(SPTAppRemoteControlScope, appRemoteControl, "app-remote-control", (1 << 14)) \ -SPT_SCOPE(SPTUserReadPlaybackStateScope, userReadPlaybackState, "user-read-playback-state", (1 << 15)) \ -SPT_SCOPE(SPTUserModifyPlaybackStateScope, userModifyPlaybackState, "user-modify-playback-state", (1 << 16)) \ -SPT_SCOPE(SPTUserReadCurrentlyPlayingScope, userReadCurrentlyPlaying, "user-read-currently-playing", (1 << 17)) \ -SPT_SCOPE(SPTUserReadRecentlyPlayedScope, userReadRecentlyPlayed, "user-read-recently-played", (1 << 18)) \ -SPT_SCOPE(SPTOpenIdScope, openid, "openid", (1 << 19)) - -/** - `SPTScope` represents the OAuth scopes that declare how your app wants to access a user's account. - See https://developer.spotify.com/web-api/using-scopes/ for more information. -*/ -typedef NS_OPTIONS(NSUInteger, SPTScope) -{ - /// Read access to user's private playlists. - SPTPlaylistReadPrivateScope NS_SWIFT_NAME(playlistReadPrivate) = (1 << 0), - /// Include collaborative playlists when requesting a user's playlists. - SPTPlaylistReadCollaborativeScope NS_SWIFT_NAME(playlistReadCollaborative) = (1 << 1), - /// Write access to a user's public playlists. - SPTPlaylistModifyPublicScope NS_SWIFT_NAME(playlistModifyPublic) = (1 << 2), - /// Write access to a user's private playlists. - SPTPlaylistModifyPrivateScope NS_SWIFT_NAME(playlistModifyPrivate) = (1 << 3), - /// Read access to the list of artists and other users that the user follows. - SPTUserFollowReadScope NS_SWIFT_NAME(userFollowRead) = (1 << 4), - /// Write/delete access to the list of artists and other users that the user follows. - SPTUserFollowModifyScope NS_SWIFT_NAME(userFollowModify) = (1 << 5), - /// Read access to a user's "Your Music" library. - SPTUserLibraryReadScope NS_SWIFT_NAME(userLibraryRead) = (1 << 6), - /// Write/delete access to a user's "Your Music" library. - SPTUserLibraryModifyScope NS_SWIFT_NAME(userLibraryModify) = (1 << 7), - /// Read access to the user's birthdate. - SPTUserReadBirthDateScope NS_SWIFT_NAME(userReadBirthDate) = (1 << 8), - /// Read access to user’s email address. - SPTUserReadEmailScope NS_SWIFT_NAME(userReadEmail) = (1 << 9), - /// Read access to user’s subscription details (type of user account). - SPTUserReadPrivateScope NS_SWIFT_NAME(userReadPrivate) = (1 << 10), - /// Read access to a user's top artists and tracks. - SPTUserTopReadScope NS_SWIFT_NAME(userTopRead) = (1 << 11), - /// Upload user generated content images - SPTUGCImageUploadScope NS_SWIFT_NAME(ugcImageUpload) = (1 << 12), - /// Control playback of a Spotify track. - SPTStreamingScope NS_SWIFT_NAME(streaming) = (1 << 13), - /// Use App Remote to control playback in the Spotify app - SPTAppRemoteControlScope NS_SWIFT_NAME(appRemoteControl) = (1 << 14), - /// Read access to a user’s player state. - SPTUserReadPlaybackStateScope NS_SWIFT_NAME(userReadPlaybackState) = (1 << 15), - /// Write access to a user’s playback state - SPTUserModifyPlaybackStateScope NS_SWIFT_NAME(userModifyPlaybackState) = (1 << 16), - /// Read access to a user’s currently playing track - SPTUserReadCurrentlyPlayingScope NS_SWIFT_NAME(userReadCurrentlyPlaying) = (1 << 17), - /// Read access to a user’s currently playing track - SPTUserReadRecentlyPlayedScope NS_SWIFT_NAME(userReadRecentlyPlayed) = (1 << 18), - /// Indicate that the application intends to use OIDC to verify the user's identity - SPTOpenIdScope NS_SWIFT_NAME(openid) = (1 << 19), -}; - diff --git a/SpotifyiOS.framework/Headers/SPTSession.h b/SpotifyiOS.framework/Headers/SPTSession.h deleted file mode 100644 index 6dbe849..0000000 --- a/SpotifyiOS.framework/Headers/SPTSession.h +++ /dev/null @@ -1,32 +0,0 @@ -#import "SPTScope.h" - -NS_ASSUME_NONNULL_BEGIN - - -/// The `SPTSession` represents an authenticated Spotify user session. -@interface SPTSession : NSObject - -/// The access token of the authenticated user. -@property (nonatomic, readonly, copy) NSString *accessToken; - -/// The refresh token. -@property (nonatomic, readonly, copy) NSString *refreshToken; - -/// The expiration date of the access token. -@property (nonatomic, readonly, copy) NSDate *expirationDate; - -/// The scope granted. -@property (nonatomic, readonly) SPTScope scope; - -/** - Check whether the session has expired. `YES` if expired; `NO` otherwise. - Note: The session is considered expired once the current date and time is equal to or greater than the expiration date and time. -*/ -@property (nonatomic, readonly, getter=isExpired) BOOL expired; - -- (instancetype)init NS_UNAVAILABLE; - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SPTSessionManager.h b/SpotifyiOS.framework/Headers/SPTSessionManager.h deleted file mode 100644 index 7f48942..0000000 --- a/SpotifyiOS.framework/Headers/SPTSessionManager.h +++ /dev/null @@ -1,130 +0,0 @@ -#import -#import "SPTScope.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SPTConfiguration, SPTSession; -@protocol SPTSessionManagerDelegate; - -/// Options for determining the most suitable method for authorization -typedef NS_OPTIONS(NSUInteger, SPTAuthorizationOptions) -{ - /// Authorize using a suitable method. If Spotify is installed the app will be used instead of a web view - SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0), - /// Authorize using only the Spotify client. If Spotify is not installed authorization will fail. - SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0), -} NS_SWIFT_NAME(AuthorizationOptions); - -typedef NSString * const SPTAuthorizationCode; - - -/// This class manages a Spotify user session, in the form of `SPTSession`. -@interface SPTSessionManager : NSObject - -/// The `SPTSession` for the `SPTSessionManager` to manage. If no user has been authenticated this will be nil -@property (nullable, nonatomic, strong) SPTSession *session; - -/// The `SPTSessionManagerDelegate` to notify of initiating a session, renewing a session, and/or errors related to a session -@property (nullable, nonatomic, weak) id delegate; - -/** - Determine if the Spotify app is installed. - - Will be `YES` if the Spotify app is installed (and the URL scheme is whitelisted), otherwise is `NO`. - Note: You must whitelist the "spotify" URL scheme in your info.plist LSApplicationQueriesSchemes or this will always be NO - */ -@property (nonatomic, readonly, getter=isSpotifyAppInstalled) BOOL spotifyAppInstalled; - -/** - Set this value to `YES` when debugging to have the Spotify app always show the authorization confirmation screen. - You SHOULD NOT set this value to `YES` in production or your users will always have to confirm. - */ -@property (nonatomic, assign) BOOL alwaysShowAuthorizationDialog; - -- (instancetype)init NS_UNAVAILABLE; - -/** - Initiate the authorization process - - @param scope The scope to request, e.g. `SPTPlaylistReadPrivateScope`|`SPTUserReadEmailScope` if you wish to request read access to private playlists, and read access to the user's email address. - @param options Options bitmask that informs authorization behavior. - @param campaign The campaign identifier, to help attribute where the account linking was initiated from. - See `SPTSessionManagerDelegate` for messages regarding changes in session state. - */ -- (void)initiateSessionWithScope:(SPTScope)scope - options:(SPTAuthorizationOptions)options - campaign:(nullable NSString *)campaign; - -/// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid. -- (void)renewSession; - -/** - Create an `SPTSessionManager` with the provided configuration. - - @param configuration An `SPTConfiguration` object. - @param delegate An optional delegate conforming to `SPTSessionManagerDelegate`. - @return An `SPTSessionManager` with the desired configuration. -*/ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration - delegate:(nullable id )delegate; - -+ (instancetype)sessionManagerWithConfiguration:(SPTConfiguration *)configuration - delegate:(nullable id )delegate; -/** - Handle openURL callbacks from the `AppDelegate` - - @param application The `UIApplication` passed into the matching `AppDelegate` method - @param URL The URL to attempt to parse the access token from - @param options The options passed in to the matching `AppDelegate` method - @return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`. -*/ -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)URL - options:(NSDictionary *)options; - -@end - -/// The `SPTSessionManagerDelegate` to use for monitoring state changes of a `SPTSessionManager` -@protocol SPTSessionManagerDelegate - -/** - This message is sent when a session has been initiated successfully. - - @param manager The `SPTSessionManager` that initiated the session. - @param session The initiated `SPTSession` object. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didInitiateSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didInitiate:)); - -/** - This message is sent when the manager failed to initiate or renew a session. - - @param manager The `SPTSessionManager` instance. - @param error The `NSError` that occured. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didFailWithError:(NSError *)error NS_SWIFT_NAME(sessionManager(manager:didFailWith:)); - -@optional - -/** - This message is sent when the manager has renewed a session. - - @param manager The `SPTSessionManager` instance. - @param session The renewed `SPTSession` object. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didRenewSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didRenew:)); - -/** - Sent when the `SPTSessionManager` has obtained an authorization code, - and is about to swap it for an access token. If you wish to handle this - yourself, return `NO` and use the provided authorization code. - - @param manager The `SPTSessionManager` instance. - @param code An OAuth authorization code. - @return `NO` to request the access token yourself; `YES` to let `SPTSessionManager` handle it. -*/ -- (BOOL)sessionManager:(SPTSessionManager *)manager shouldRequestAccessTokenWithAuthorizationCode:(SPTAuthorizationCode)code NS_SWIFT_NAME(sessionManager(manager:shouldRequestAccessTokenWith:)); - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Headers/SpotifyAppRemote.h b/SpotifyiOS.framework/Headers/SpotifyAppRemote.h deleted file mode 100644 index 5383aa5..0000000 --- a/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -#ifndef _SPOTIFYAPPREMOTE_ -#define _SPOTIFYAPPREMOTE_ - -#import "SPTAppRemote.h" -#import "SPTAppRemoteCommon.h" - -#import "SPTAppRemoteConnectionParams.h" - -#import "SPTAppRemoteImageAPI.h" -#import "SPTAppRemotePlayerAPI.h" -#import "SPTAppRemoteUserAPI.h" -#import "SPTAppRemoteContentAPI.h" - -#import "SPTAppRemoteAlbum.h" -#import "SPTAppRemoteArtist.h" -#import "SPTAppRemotePlaybackOptions.h" -#import "SPTAppRemotePlaybackRestrictions.h" -#import "SPTAppRemotePlayerState.h" -#import "SPTAppRemoteCrossfadeState.h" -#import "SPTAppRemoteTrack.h" -#import "SPTAppRemoteUserCapabilities.h" -#import "SPTAppRemoteLibraryState.h" -#import "SPTAppRemoteContentItem.h" -#import "SPTAppRemotePodcastPlaybackSpeed.h" -#import "SPTAppRemoteConnectivityAPI.h" -#import "SPTAppRemoteConnectivityState.h" - -#import "SPTConfiguration.h" - -#endif /* _SPOTIFYAPPREMOTE_ */ diff --git a/SpotifyiOS.framework/Headers/SpotifyiOS.h b/SpotifyiOS.framework/Headers/SpotifyiOS.h deleted file mode 100644 index cb1bef2..0000000 --- a/SpotifyiOS.framework/Headers/SpotifyiOS.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _SPOTIFYIOS_ -#define _SPOTIFYIOS_ - -#import "SpotifyAppRemote.h" -#import "SPTLogin.h" - -#endif /* _SPOTIFYIOS_ */ diff --git a/SpotifyiOS.framework/SpotifyiOS b/SpotifyiOS.framework/SpotifyiOS deleted file mode 100644 index dafecbb..0000000 Binary files a/SpotifyiOS.framework/SpotifyiOS and /dev/null differ diff --git a/SpotifyiOS.framework/SpotifyiOS b/SpotifyiOS.framework/SpotifyiOS new file mode 120000 index 0000000..5ac41ae --- /dev/null +++ b/SpotifyiOS.framework/SpotifyiOS @@ -0,0 +1 @@ +Versions/Current/SpotifyiOS \ No newline at end of file diff --git a/SpotifyiOS.framework/Versions/A/SpotifyiOS b/SpotifyiOS.framework/Versions/A/SpotifyiOS index dafecbb..2958876 100644 Binary files a/SpotifyiOS.framework/Versions/A/SpotifyiOS and b/SpotifyiOS.framework/Versions/A/SpotifyiOS differ diff --git a/SpotifyiOS.framework/Versions/Current b/SpotifyiOS.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/SpotifyiOS.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemote.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemote.h deleted file mode 100644 index a758a79..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemote.h +++ /dev/null @@ -1,285 +0,0 @@ -#import - -@class SPTAppRemote; -@class SPTAppRemoteConnectionParams; -@class SPTConfiguration; - -@protocol SPTAppRemoteImageAPI; -@protocol SPTAppRemotePlayerAPI; -@protocol SPTAppRemoteUserAPI; -@protocol SPTAppRemoteContentAPI; -@protocol SPTAppRemoteConnectivityAPI; - -NS_ASSUME_NONNULL_BEGIN - -extern NSString * const SPTAppRemoteAccessTokenKey; -extern NSString * const SPTAppRemoteErrorKey; -extern NSString * const SPTAppRemoteErrorDescriptionKey; - -/// The severity of log messages that the App Remote should log to console. -typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) { - /// Do not log at all. - SPTAppRemoteLogLevelNone = 0, - /// Log debug, info and error messages. - SPTAppRemoteLogLevelDebug = 1, - /// Log info and error messages. - SPTAppRemoteLogLevelInfo = 2, - /// Log only error messages. - SPTAppRemoteLogLevelError = 3, -}; - -/** - * The `SPTAppRemoteDelegate` receives updates from the `SPTAppRemote` whenever something has - * happened with the connection. - */ -@protocol SPTAppRemoteDelegate - -/** - * Called when the App Remote has established connection with the Spotify app. - * - * @param appRemote The transport that has connected. - */ -- (void)appRemoteDidEstablishConnection:(SPTAppRemote *)appRemote; - -/** - * Called when the connection attempt made by the App Remote failed. - * - * @param appRemote The App Remote that failed to connect. - * @param error The error that occurred. - */ -- (void)appRemote:(SPTAppRemote *)appRemote didFailConnectionAttemptWithError:(nullable NSError *)error; - -/** - * Called when the App Remote has disconnected. - * - * @note All APIs will be released by the App Remote at this point. The will no longer be usable, - * and so you should release them as well. - * - * @param appRemote The App Remote that disconnected. - * @param error The error that caused the disconnect, or `nil` if the disconnect was explicit. - */ -- (void)appRemote:(SPTAppRemote *)appRemote didDisconnectWithError:(nullable NSError *)error; - -@end - -/** - * The `SPTAppRemote` is the main entry point for interacting with the Spotify app using the Spotify App Remote for iOS. - */ -@interface SPTAppRemote : NSObject - -#pragma mark Lifecycle - -/** - * Convenience Initializer for a new App Remote instance - * - * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs - * @param logLevel The lowest severity to log to console. - * - * @return A fresh new App Remote, ready to connect. - */ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration logLevel:(SPTAppRemoteLogLevel)logLevel; - -/** - * Designated Initializer for a new App Remote instance - * - * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs - * @param connectionParameters `SPTAppRemoteConnectionParams` for custom image sizes and types, and to hold the accessToken - * @param logLevel The lowest severity to log to console. - * - * @return A fresh new App Remote, ready to connect. - */ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration - connectionParameters:(SPTAppRemoteConnectionParams *)connectionParameters - logLevel:(SPTAppRemoteLogLevel)logLevel NS_DESIGNATED_INITIALIZER; -#pragma mark Class Methods - -/** - * Checks if the Spotify app is active on the user's device. You can use this to determine if maybe you should prompt - * the user to connect to Spotify (because you know they are already using Spotify if it is active). The Spotify app - * will be considered active if music is playing or the app is active in the background. - * - * @param completion Completion block for determining the result of the check. YES if Spotify is active, othewise NO. - */ -+ (void)checkIfSpotifyAppIsActive:(void (^)(BOOL active))completion; - -/** - * Determine the current version of the Spotify App Remote - * - * @return The current version of the Spotify App Remote - */ -+ (NSString *)appRemoteVersion; - -/** - * The Spotify app iTunes item identifier for use with `SKStoreProductViewController` for installing Spotify from the App Store. - * - * @return An `NSNumber` representing the Spotify iTunes item identifier to be used for the `SKStoreProductParameterITunesItemIdentifier` key - */ -+ (NSNumber *)spotifyItunesItemIdentifier; - -#pragma mark Connection - -/** - * The parameters to use during connection. - */ -@property (nonatomic, strong, readonly) SPTAppRemoteConnectionParams *connectionParameters; - -/** - * `YES` if the App Remote is connected to the Spotify application, otherwise `NO`. - * - * @note Not KVO’able. - * - * See The `SPTAppRemoteDelegate` in order to receive updates when the connection status changes. - */ -@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected; - -/** - * The delegate to notify for connection status changes and other events originating from the App Remote. - */ -@property (nonatomic, weak) id delegate; - -/** - * Attempts to connect to the Spotify application. - * - * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up - */ -- (void)connect; - -/** - * Attempts to connect to the Spotify application with a given session identifier. - * - * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up. - * - * @discussion If `authorizeAndPlayURI` was used without a given session identifier, `connect` should be used instead of this method. - * - * @param sessionIdentifier The unique session identifier which was used when calling - * `authorizeAndPlayURI:asRadio:additionalScopes:sessionIdentifier:` - */ -- (void)connectWithSessionIdentifier:(NSUUID *)sessionIdentifier; - -/** - * Disconnect from the Spotify application - */ -- (void)disconnect; - -/** - * Open Spotify app to obtain access token and start playback. - * The passed URI will start playing unless Spotify is already playing. - * - * @param URI The URI to play. Use a blank string to attempt to play the user's last song - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. - */ -- (void)authorizeAndPlayURI:(NSString *)URI completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** - * Open Spotify app to obtain access token and start playback. - * - * @param playURI The URI to play. Use a blank string to attempt to play the user's last song - * @param asRadio `YES` to start radio for the given URI. - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. - */ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** -* Open Spotify app to obtain access token and start playback. -* -* @param playURI The URI to play. Use a blank string to attempt to play the user's last song -* @param asRadio `YES` to start radio for the given URI. -* @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control` -* @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. -* -* Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if -* the Spotify app is installed and can attempt to handle the authorization request. -*/ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - additionalScopes:(nullable NSArray *)additionalScopes - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; - -/** - * Open Spotify app to obtain access token and start playback. - * - * @param playURI The URI to play. Use a blank string to attempt to play the user's last song - * @param asRadio `YES` to start radio for the given URI. - * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control` - * @param sessionIdentifier An optional unique identifier for this specific session, which is used for analytics purposes. Every new attempt to - * connect to the Spotify app should have a new identifier, but the identifier used here should then be reused for the accompanied call to - * `connectWithSessionIdentifier:`. - * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`. - * - * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if - * the Spotify app is installed and can attempt to handle the authorization request. -*/ -- (void)authorizeAndPlayURI:(NSString *)playURI - asRadio:(BOOL)asRadio - additionalScopes:(nullable NSArray *)additionalScopes - sessionIdentifier:(nullable NSUUID *)sessionIdentifier - completionHandler:(void (^ __nullable)(BOOL success))completionHandler; -/** - * Parse out an access token or error description from a url passed to application:openURL:options: - * - * @param url The URL returned from the Spotify app after calling authorizeAndPlayURI - * - * @return A dictionary containing the access token or error description from the provided URL. - * Will return nil if the URL Scheme does not match the redirect URI provided. - * Use `SPTAppRemoteAccessTokenKey` and `SPTAppRemoteErrorDescriptionKey` to get the appropriate values. - */ -- (nullable NSDictionary *)authorizationParametersFromURL:(NSURL *)url; - -#pragma mark APIs - -/** - * The API used to control the Spotify player. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id playerAPI; - -/** - * The API used to fetch images from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id imageAPI; - -/** - * The API used to fetch user data from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id userAPI; - -/** - * The API used to fetch content from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id contentAPI; - -/** - * The API used to get connectivity data from the Spotify app. - * - * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on - * disconnect. - */ -@property (nullable, nonatomic, strong, readonly) id connectivityAPI; - -#pragma mark Unavailable initializers - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteAlbum.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteAlbum.h deleted file mode 100644 index 0d1b4fb..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteAlbum.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteAlbum` represents an Album entity. - */ -@protocol SPTAppRemoteAlbum - -/// The name of the album. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the album. -@property (nonatomic, copy, readonly) NSString *URI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteArtist.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteArtist.h deleted file mode 100644 index 52f34f2..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteArtist.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteArtist` represents an artist. - */ -@protocol SPTAppRemoteArtist - -/// The name of the artist. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the artist. -@property (nonatomic, copy, readonly) NSString *URI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCommon.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCommon.h deleted file mode 100644 index 1bf43b5..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCommon.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Common header definitions - */ - -NS_ASSUME_NONNULL_BEGIN - -/// The error domain for user facing errors that occur in the App Remote. -extern NSString * const SPTAppRemoteErrorDomain; - -/// The error codes in the `SPTAppRemoteErrorDomain` domain. -typedef NS_ENUM(NSInteger, SPTAppRemoteErrorCode) { - /// An unknown error. - SPTAppRemoteUnknownError = -1, - - /// The background wakeup of the Spotify app failed. - SPTAppRemoteBackgroundWakeupFailedError = -1000, - /// The connection attempt to the Spotify app failed. - SPTAppRemoteConnectionAttemptFailedError = -1001, - /// The conncetion to the Spotify app was terminated. - SPTAppRemoteConnectionTerminatedError = -1002, - /// The arguments supplied are invalid. - SPTAppRemoteInvalidArgumentsError = -2000, - /// The request has failed for some reason. - SPTAppRemoteRequestFailedError = -2001, -}; - -/** - * A callback block used by many App Remote API methods. - * - * @param result The result of the operation, or `nil` if the operation failed. - * @param error An error object, or `nil` if the operation was a success. - */ -typedef void (^SPTAppRemoteCallback)(id _Nullable result, NSError * _Nullable error); - -NS_ASSUME_NONNULL_END - diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectionParams.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectionParams.h deleted file mode 100644 index 808708f..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectionParams.h +++ /dev/null @@ -1,65 +0,0 @@ -#import - -/// Available image formats to receive from the Spotify app. -typedef NS_ENUM(NSUInteger, SPTAppRemoteConnectionParamsImageFormat) { - /// Any image format is acceptable. Use this if you don't care about which image format is sent. - SPTAppRemoteConnectionParamsImageFormatAny = 0, - /// JPEG image format. - SPTAppRemoteConnectionParamsImageFormatJPEG, - /// PNG image format. - SPTAppRemoteConnectionParamsImageFormatPNG, -}; - -struct CGSize; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteconnectionParams` represents connection parameters required in order to initiate a connection - * with the Spotify app. - */ -@interface SPTAppRemoteConnectionParams : NSObject - -/// The access token used to authorize the user with the Spotify app. -@property (nonatomic, copy, readwrite, nullable) NSString *accessToken; - -/// The desired size of received images. (0,0) acts as a wildcard and accepts any size. -@property (nonatomic, assign, readonly) struct CGSize defaultImageSize; - -/// The desired image format of received images. -@property (nonatomic, assign, readonly) SPTAppRemoteConnectionParamsImageFormat imageFormat; - -/** - * Initialize a set of new connection parameters. - * - * @discussion This is the designated initializer. - * - * @param accessToken The access token obtained after authentication. - * @param defaultImageSize The desired size of received images. (0,0) acts as a wildcard and accepts any size. - * @param imageFormat The desired image format of received images. - * - * @return A set of connection parameters ready to be used when initiating a connection to the Spotify app. - */ -- (instancetype)initWithAccessToken:(nullable NSString *)accessToken - defaultImageSize:(struct CGSize)defaultImageSize - imageFormat:(SPTAppRemoteConnectionParamsImageFormat)imageFormat NS_DESIGNATED_INITIALIZER; - -#pragma mark Static properties - -/// Version of the protocol -@property (nonatomic, assign, readonly) NSInteger protocolVersion; - -/// Roles -@property (nonatomic, copy, readonly) NSDictionary *roles; - -/// Authentication methods supported -@property (nonatomic, copy, readonly) NSArray *authenticationMethods; - -#pragma mark Unavailable initializers - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityAPI.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityAPI.h deleted file mode 100644 index dbc6792..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityAPI.h +++ /dev/null @@ -1,54 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" - -@protocol SPTAppRemoteConnectivityAPI; -@protocol SPTAppRemoteConnectivityState; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteConnectivityAPIDelegate` gets notified whenever the connectivity API receives new data from subscription events. - */ -@protocol SPTAppRemoteConnectivityAPIDelegate - -/** - * Called when the connectivity state has been updated. - * - * @param connectivityAPI The API that received updates. - * @param connectivityState The new connectivity state received. - */ -- (void)connectivityAPI:(id)connectivityAPI didReceiveNewConnectivityState:(id)connectivityState; - -@end - -/** - The @c SPTAppRemoteConnectivityAPI class is used to get connectivity data from the Spotify app. - */ -@protocol SPTAppRemoteConnectivityAPI - -/// The delegate receiving player state updates -@property (nonatomic, weak) id delegate; - -/** - * Subscribes to connection state changes from the Spotify app. - * - * @note Implement `SPTAppRemoteConnectivityAPIDelegate` and set yourself as delegate in order to be notified when the - * the connection state changes. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)subscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to connection state changes from the Spotify app. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)unsubscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityState.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityState.h deleted file mode 100644 index 047b340..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteConnectivityState.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - The @c SPTAppRemoteConnectivityState class represents the online/offline state of the Spotify app. - */ -@protocol SPTAppRemoteConnectivityState - -/// Whether the Spotify app is offline or not. -@property (nonatomic, readonly, getter=isOffline) BOOL offline; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentAPI.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentAPI.h deleted file mode 100644 index 82843e4..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentAPI.h +++ /dev/null @@ -1,76 +0,0 @@ -#import -#import "SPTAppRemoteCommon.h" - -NS_ASSUME_NONNULL_BEGIN - -/// A type representing different lists of content. -typedef NSString * const SPTAppRemoteContentType; - -extern NSString * const SPTAppRemoteContentTypeDefault; -extern NSString * const SPTAppRemoteContentTypeNavigation; -extern NSString * const SPTAppRemoteContentTypeFitness; -extern NSString * const SPTAppRemoteContentTypeGaming; - -@protocol SPTAppRemoteContentItem; - -/** - * The `SPTAppRemoteContentAPI` is used to access content from the Spotify application. - */ -@protocol SPTAppRemoteContentAPI - -/** - * Fetches the root level of content items for the current user. - * - * @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. - * - * @param contentType A type that is used to retrieve content for a specific use-case. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchRootContentItemsForType:(SPTAppRemoteContentType)contentType - callback:(nullable SPTAppRemoteCallback)callback DEPRECATED_MSG_ATTRIBUTE("Deprecated. Use fetchRecommendedContentItemsForType:flattenContainers:callback: instead."); - -/** - * Fetches the children items for the provided content item. - * - * @note The `isContainer` property of the `SPTAppRemoteContentItem` - * indicates whether or not the item has any children. - * - * @param contentItem The content item to fetch the children for. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchChildrenOfContentItem:(id)contentItem - callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Fetches a list of recommended playlists for the current user. - * - * @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. - * - * @param contentType A type that is used to retrieve content for a specific use-case. - * @param flattenContainers Whether or not the recommendations should be flattened into a single list or remain - * separated in containers. - * @param callback The callback to be called once the request is completed. - */ -- (void)fetchRecommendedContentItemsForType:(SPTAppRemoteContentType)contentType - flattenContainers:(BOOL)flattenContainers - callback:(nullable SPTAppRemoteCallback)callback; - -/** - Fetches the content item for the provided URI. - - @param URI A Spotify URI as string - @param callback The callback to be called once the request is completed. - */ -- (void)fetchContentItemForURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentItem.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentItem.h deleted file mode 100644 index a1d5b42..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteContentItem.h +++ /dev/null @@ -1,49 +0,0 @@ -#import -#import "SPTAppRemoteImageRepresentable.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteContentItem` protocol represents a track or a collection of tracks. Use the `isContainer` instance method - * to determine if the content item is a collection of tracks for which to grab children from. - */ -@protocol SPTAppRemoteContentItem - -/// The primary title of the item. -@property (nonatomic, copy, readonly, nullable) NSString *title; - -/// The secondary title of the item. -@property (nonatomic, copy, readonly, nullable) NSString *subtitle; - -/// The description of the item. -@property (nonatomic, copy, readonly, nullable) NSString *contentDescription; - -/// The unique identifier of the item. -@property (nonatomic, copy, readonly) NSString *identifier; - -/// The playback URI of this item. -@property (nonatomic, copy, readonly) NSString *URI; - -/// `YES` if the item is available offline, or if it has any child that is available offline, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isAvailableOffline) BOOL availableOffline; - -/// Returns `YES` if the item is directly playable, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isPlayable) BOOL playable; - -/// Returns `YES` if the item is expected to contain children, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isContainer) BOOL container; - -/// Returns `YES` if the item is pinned in Your Library, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isPinned) BOOL pinnned; - -/** - A list of the content item's children. - - @note This is not populated for all container items as some of them are fetched - lazily with the `fetchChildrenOfContentItem:callback:` method. - */ -@property (nonatomic, strong, readonly, nullable) NSArray> *children; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCrossfadeState.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCrossfadeState.h deleted file mode 100644 index c59c4b0..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteCrossfadeState.h +++ /dev/null @@ -1,18 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteCrossfadeState` represents the state of crossfade. - */ -@protocol SPTAppRemoteCrossfadeState - -/// The on/off state of crossfade. -@property (nonatomic, readonly, getter=isEnabled) BOOL enabled; - -/// The duration of crossfade in milliseconds. The value is meaningless if crossfade is not enabled. -@property (nonatomic, readonly) NSInteger duration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageAPI.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageAPI.h deleted file mode 100644 index 75e8e75..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageAPI.h +++ /dev/null @@ -1,25 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" -#import "SPTAppRemoteImageRepresentable.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - * API for fetching image data from the Spotify app - */ -@protocol SPTAppRemoteImageAPI - -/** - * Fetch an image with the given ID from the Spotify app. - * - * @param imageRepresentable The item containing the ID of the image to fetch. - * @param imageSize The size of the image to fetch. - * @param callback On success `result` will be an instance of `UIImage` - * On error `result` will be nil and error set - */ -- (void)fetchImageForItem:(id)imageRepresentable withSize:(CGSize)imageSize callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageRepresentable.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageRepresentable.h deleted file mode 100644 index 656347e..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteImageRepresentable.h +++ /dev/null @@ -1,16 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTImageRepresentable` protocol represents an object that may contain an image. - * If something conforms to this protocol you can pass it to `SPTAppRemoteImageAPI` fetchImageForItem: method. - */ -@protocol SPTAppRemoteImageRepresentable - -/// The identifier of the image of the entity. -@property (nonatomic, strong, readonly) NSString *imageIdentifier; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteLibraryState.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteLibraryState.h deleted file mode 100644 index 7a44c1c..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteLibraryState.h +++ /dev/null @@ -1,19 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteLibraryState` represents a the state of an album or track in a users Spotify library. - */ -@protocol SPTAppRemoteLibraryState - -/// The uri of the track or album -@property (nonatomic, strong, readonly) NSString *uri; -/// `YES` album or track was added to the user's library, otherwise `NO`. -@property (nonatomic, assign, readonly) BOOL isAdded; -/// `YES` album or track can be added to the user's library, otherwise `NO`. -@property (nonatomic, assign, readonly) BOOL canAdd; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackOptions.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackOptions.h deleted file mode 100644 index 4135d73..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackOptions.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/// The available repeat modes. -typedef NS_ENUM(NSUInteger, SPTAppRemotePlaybackOptionsRepeatMode) { - /// Repeat is off. - SPTAppRemotePlaybackOptionsRepeatModeOff = 0, - - /// Repeats the current track. - SPTAppRemotePlaybackOptionsRepeatModeTrack = 1, - - /// Repeats the current context. - SPTAppRemotePlaybackOptionsRepeatModeContext = 2, -}; - -/** - * The `SPTAppRemotePlaybackOptions` describes a set of options used for the current playback. - * - * @discussion Use these to determine UI states. - */ -@protocol SPTAppRemotePlaybackOptions - -/// `YES` if shuffle is enabled, otherwise `NO`. -@property (nonatomic, readonly) BOOL isShuffling; - -/// The current repeat mode in effect. -@property (nonatomic, readonly) SPTAppRemotePlaybackOptionsRepeatMode repeatMode; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackRestrictions.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackRestrictions.h deleted file mode 100644 index 8b5c6b0..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlaybackRestrictions.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlaybackRestrictions` describes a set of restrictions for playback in the Spotify client. - * - * @discussion Use these to determine whether to enable or disable certain actions in the UI. - */ -@protocol SPTAppRemotePlaybackRestrictions - -/// `YES` if the user can skip to the next track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSkipNext; - -/// `YES` if the user can skip to the previous track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSkipPrevious; - -/// `YES` if the user can repeat the current track, otherwise `NO`. -@property (nonatomic, readonly) BOOL canRepeatTrack; - -/// `YES` if the user can repeat the current context, otherwise `NO`. -@property (nonatomic, readonly) BOOL canRepeatContext; - -/// `YES` if the user can toggle shuffle, otherwise `NO`. -@property (nonatomic, readonly) BOOL canToggleShuffle; - -/// `YES` if the user can seek to specific positions, otherwise `NO`. -@property (nonatomic, readonly) BOOL canSeek; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerAPI.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerAPI.h deleted file mode 100644 index d202ffb..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerAPI.h +++ /dev/null @@ -1,262 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" -#import "SPTAppRemotePlaybackOptions.h" - -@protocol SPTAppRemotePlayerState, SPTAppRemoteContentItem, SPTAppRemotePodcastPlaybackSpeed; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlayerStateDelegate` is used to get notifications from the Spotify app when the player state is changed. - */ -@protocol SPTAppRemotePlayerStateDelegate - -/** - * Called when the player state has been updated. - * - * @param playerState The new player state. - */ -- (void)playerStateDidChange:(id)playerState; - -@end - -/** - * The `SPTAppRemotePlayerAPI` is used to interact with and control the Spotify player. - */ -@protocol SPTAppRemotePlayerAPI - -/// The delegate receiving player state updates -@property (nonatomic, weak) id delegate; - -#pragma mark Player Control - -/** - * Asks the Spotify player to play the entity with the given identifier. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * - * @param entityIdentifier The unique identifier of the entity to play. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)play:(NSString *)entityIdentifier callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the entity with the given identifier. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * - * @param trackUri The track URI to play. - * @param asRadio `YES` to start radio for track URI. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)play:(NSString *)trackUri asRadio:(BOOL)asRadio callback:(SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the provided content item. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is - * playable. - * - * @param contentItem The content item to play. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)playItem:(id)contentItem callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to play the provided content item starting at the specified index. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track begins to play. - * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is - * playable. - * @note Sending an `index` parameter that is out of bounds is undefined. - * - * @param contentItem The content item to play. - * @param index The index of the track to skip to if applicable. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)playItem:(id)contentItem skipToTrackIndex:(NSInteger) index callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to resume playback. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the playback resumes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be nil and error set - */ -- (void)resume:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to pause playback. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the playback pauses. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)pause:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to skip to the next track. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track changes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and error set - */ -- (void)skipToNext:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to skip to the previous track. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the track changes. - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)skipToPrevious:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek to the specified position. - * - * @param position The position to seek to in milliseconds. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekToPosition:(NSInteger)position callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek forward 15 seconds. - * Note: You should only use this method if isEpisode = YES for the currently playing track - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekForward15Seconds:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to seek backward 15 seconds. - * Note: You should only use this method if isEpisode = YES for the currently playing track - * - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)seekBackward15Seconds:(nullable SPTAppRemoteCallback)callback; - -#pragma mark Playback Options - -/** - * Asks the Spotify player to set shuffle mode. - * - * @param shuffle `YES` to enable shuffle, `NO` to disable. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)setShuffle:(BOOL)shuffle callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player to set the repeat mode. - * - * @param repeatMode The repeat mode to set. - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)setRepeatMode:(SPTAppRemotePlaybackOptionsRepeatMode)repeatMode callback:(nullable SPTAppRemoteCallback)callback; - -#pragma mark Player State - -/** - * Asks the Spotify player for the current player state. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)getPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Subscribes to player state changes from the Spotify app. - * - * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the - * the player state changes. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)subscribeToPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to player state changes from the Spotify app. - * - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)unsubscribeToPlayerState:(nullable SPTAppRemoteCallback)callback; - -/** - * Adds a track to the user's currently playing queue - * - * @param trackUri The track URI to add to the queue - * @param callback On success `result` will be `YES` - * On error `result` will be `nil` and error set - */ -- (void)enqueueTrackUri:(NSString*)trackUri callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for available podcast playback speeds - * - * @param callback On success `result` will be an `NSArray` of `SPTAppRemotePodcastPlaybackSpeed` objects - * On error `result` will be `nil` and `error` set - */ -- (void)getAvailablePodcastPlaybackSpeeds:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for the current podcast playback speed - * - * @note Podcast playback speed is seperate from other contents' playback speed. This value is only used for podcasts - * - * @param callback On success `result` will be a `SPTAppRemotePodcastPlaybackSpeed` - * On error `result` will be `nil` and `error` set - */ -- (void)getCurrentPodcastPlaybackSpeed:(nullable SPTAppRemoteCallback)callback; - -/** - * Set the current podcast playback speed - * - * @note This playback speed will only affect podcasts and not other types of media. If you set this - * when a podcast is not playing this will be the default value when a podcast does begin to play. For this reason - * you may get a successful callback when setting this even when a podcast is not playing and the current playback - * speed does not change. - * - * @note You should use `getAvailablePodcastPlaybackSpeeds:` to get a list of valid speeds to pass to this method - * - * @param speed The `SPTAppRemotePodcastPlaybackSpeed` to set as the current podcast playback speed - * @param callback On success `result` will be `YES`. - * On error `result` will be `nil` and `error` set - */ -- (void)setPodcastPlaybackSpeed:(nonnull id)speed callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Asks the Spotify player for the current crossfade state. - * - * @param callback On success `result` will be an instance of `id` - * On error `result` will be nil and error set - */ -- (void)getCrossfadeState:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerState.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerState.h deleted file mode 100644 index 4b2305d..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePlayerState.h +++ /dev/null @@ -1,40 +0,0 @@ -#import - -@protocol SPTAppRemoteTrack; -@protocol SPTAppRemotePlaybackOptions; -@protocol SPTAppRemotePlaybackRestrictions; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePlayerState` represents the state within the Spotify player. - */ -@protocol SPTAppRemotePlayerState - -/// The track being played in the Spotify player. -@property (nonatomic, readonly) id track; - -/// The position of the playback in the Spotify player. -@property (nonatomic, readonly) NSInteger playbackPosition; - -/// The speed of the playback in the Spotify player. -@property (nonatomic, readonly) float playbackSpeed; - -/// `YES` if the Spotify player is paused, otherwise `NO`. -@property (nonatomic, readonly, getter=isPaused) BOOL paused; - -/// The playback restrictions currently in effect. -@property (nonatomic, readonly) id playbackRestrictions; - -/// The playback options currently in effect. -@property (nonatomic, readonly) id playbackOptions; - -/// The title of the currently playing context (e.g. the name of the playlist). -@property (nonatomic, readonly) NSString *contextTitle; - -/// The URI of the currently playing context (e.g. the URI of the playlist). -@property (nonatomic, readonly) NSURL *contextURI; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePodcastPlaybackSpeed.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePodcastPlaybackSpeed.h deleted file mode 100644 index 90113a2..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemotePodcastPlaybackSpeed.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemotePodcastPlaybackSpeed` represents playback speed(s) for podcasts - */ -@protocol SPTAppRemotePodcastPlaybackSpeed - -/// The speed multiplier representing this podcast speed. 0.5 = half speed, 2 = twice as fast, 1 = normal playback -@property (nonatomic, strong, readonly) NSNumber *value; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteTrack.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteTrack.h deleted file mode 100644 index f9de56e..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteTrack.h +++ /dev/null @@ -1,52 +0,0 @@ -#import "SPTAppRemoteImageRepresentable.h" - -@protocol SPTAppRemoteAlbum; -@protocol SPTAppRemoteArtist; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteTrack` represents a track. - */ -@protocol SPTAppRemoteTrack - -/// The name of the track. -@property (nonatomic, copy, readonly) NSString *name; - -/// The URI of the track. -@property (nonatomic, copy, readonly) NSString *URI; - -/// The duration of the track in miliseconds. -@property (nonatomic, assign, readonly) NSUInteger duration; - -/// The artist of the track. -@property (nonatomic, strong, readonly) id artist; - -/// The album of the track. -@property (nonatomic, strong, readonly) id album; - -/// `YES` if the user has saved the track, otherwise `NO`. -@property (nonatomic, assign, readonly, getter=isSaved) BOOL saved; - -/** - * `YES` if the track is a podcast, video, or other audio episode, otherwise `NO`. - * If the track is an episode and `SPTAppRemotePlaybackRestrictions` `canSeek` is `YES` you should show - * 15 second skip buttons in your UI. - */ -@property (nonatomic, assign, readonly, getter=isEpisode) BOOL episode; - -/** - * `YES` if the track is a podcast, otherwise `NO`. - * If the track is a podcast and `SPTAppRemotePlaybackRestrictions` `canSeek` is `YES` you should show - * 15 second skip buttons in your UI as well as a podcast speed control to change playback speed. - */ -@property (nonatomic, assign, readonly, getter=isPodcast) BOOL podcast; - -/** - * `YES` if the track is an ad, otherwise `NO`. - */ -@property (nonatomic, assign, readonly, getter=isAdvertisement) BOOL advertisement; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserAPI.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserAPI.h deleted file mode 100644 index 79ee075..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserAPI.h +++ /dev/null @@ -1,103 +0,0 @@ -#import - -#import "SPTAppRemoteCommon.h" - -@protocol SPTAppRemoteUserAPI; -@protocol SPTAppRemoteUserCapabilities; - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteUserAPIDelegate` gets notified whenever the user API receives new data from subscription events. - */ -@protocol SPTAppRemoteUserAPIDelegate - -/** - * Called when the capabilities has been updated. - * - * @note This will only be called if there is an active capabilities subscription. - * - * @param userAPI The API that received updates. - * @param capabilities The new capabilities that was received. - */ -- (void)userAPI:(id)userAPI didReceiveCapabilities:(id)capabilities; - -@end - -/** - * The `SPTAppRemoteUserAPI` is used to get user data from, and interact with user features in, the Spotify app. - */ -@protocol SPTAppRemoteUserAPI - -/// The User API delegate gets notified whenever the API receives new data from subscription events. -@property (nonatomic, weak, readwrite) id delegate; - -/** - * Fetches the current users capabilities from the Spotify app. - * - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)fetchCapabilitiesWithCallback:(nullable SPTAppRemoteCallback)callback; - -/** - * Subscribes to capability changes from the Spotify app. - * - * @note Implement `SPTAppRemoteUserAPIDelegate` and set yourself as `delegate` in order to be notified when the - * the capabilities changes. - * - * @param callback A callback block that will be invoked when the subscription request has completed. - * On success `result` will `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)subscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback; - -/** - * Stops subscribing to capability changes from the Spotify app. - * - * @param callback A callback block that will be invoked when the unsubscription request has completed. - * On success `result` will be `YES`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)unsubscribeToCapabilityChanges:(nullable SPTAppRemoteCallback)callback; - -/** - * Fetches the current users library state for a given album or track uri. - * - * @param URI The URI of the album or track we are fetching the state for - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id`. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)fetchLibraryStateForURI:(NSString *)URI callback:(SPTAppRemoteCallback)callback; - -/** - * Add item to the users library. - * Currently supported uris include: - * Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 - * Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6 - * - * @param URI The URI of the item to save - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id` that indicates the resulting state of the entity. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)addItemToLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -/** - * Remove item from users library. - * Currently supported uris include: - * Tracks - example: spotify:track:6rqhFgbbKwnb9MLmUQDhG6 - * Albums - example: spotify:album:2VYSDvc0ZdcfkXDcYVjHs6 - * - * @param URI The URI of the item to remove - * @param callback A callback block that will be invoked when the fetch request has completed. - * On success `result` will be an instance of `id` that indicates the resulting state of the entity. - * On error `result` will be `nil` and `error` will be set. - */ -- (void)removeItemFromLibraryWithURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserCapabilities.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserCapabilities.h deleted file mode 100644 index 0dde3e6..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTAppRemoteUserCapabilities.h +++ /dev/null @@ -1,15 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * The `SPTAppRemoteUserCapabilities` represents a set of capabilities the current user has in the Spotify app. - */ -@protocol SPTAppRemoteUserCapabilities - -/// `YES` if the user can play songs on demand, otherwise `NO`. This will differ for premium and non-premium users -@property (nonatomic, assign, readonly) BOOL canPlayOnDemand; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTConfiguration.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTConfiguration.h deleted file mode 100644 index 3a0f681..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTConfiguration.h +++ /dev/null @@ -1,66 +0,0 @@ -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - A configuration class, holding the credentials provided for your app on the Spotify Developer website. - See https://developer.spotify.com/my-applications/ -*/ -@interface SPTConfiguration : NSObject - -/// Your app's Client ID from developer.spotify.com -@property (nonatomic, readonly, copy) NSString *clientID; - -/// Your redirect URL. This is how the Spotify app will open your application after user authorization. -@property (nonatomic, readonly, copy) NSURL *redirectURL; - -/// Name of the company -@property (nonatomic, nullable, copy) NSString *companyName; - -/** - 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; - -/** - 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; - -/** - 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; - -- (instancetype)init NS_UNAVAILABLE; - -/** - Designated initializer for `SPTConfiguration` - - @param clientID Your client ID obtained from developer.spotify.com - @param redirectURL Your redirect URL for Spotify to open your app again after authorization - @return A newly initialized `SPTConfiguration` - */ -- (instancetype)initWithClientID:(NSString *)clientID - redirectURL:(NSURL *)redirectURL NS_DESIGNATED_INITIALIZER; - -/** - Convenience intializer for `SPtConfiguration` - - @param clientID Your client ID obtained from developer.spotify.com - @param redirectURL Your redirect URL for Spotify to open your app again after authorization - @return A newly initialized `SPTConfiguration` - */ -+ (instancetype)configurationWithClientID:(NSString *)clientID - redirectURL:(NSURL *)redirectURL NS_SWIFT_UNAVAILABLE("superfluous"); - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTError.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTError.h deleted file mode 100644 index a470cd1..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTError.h +++ /dev/null @@ -1,33 +0,0 @@ -#import - -#import "SPTMacros.h" - -NS_ASSUME_NONNULL_BEGIN - -SPT_EXPORT NSErrorDomain const SPTLoginErrorDomain; - -/// Spotify error codes, use NSUnderlyingErrorKey to see the underlying error -typedef NS_ENUM(NSUInteger, SPTErrorCode) -{ - /// Unknown error code - SPTUnknownErrorCode NS_SWIFT_NAME(unknown) = 0, - /// Authorization failed - SPTAuthorizationFailedErrorCode NS_SWIFT_NAME(authorizationFailed), - /// Renew session failed - SPTRenewSessionFailedErrorCode NS_SWIFT_NAME(renewSessionFailed), - /// Failed to parse the returned JSON - SPTJSONFailedErrorCode NS_SWIFT_NAME(jsonFailed), -}; - -/// Spotify-specific errors. Use NSUnderlyingErrorKey to see the underlying error -@interface SPTError : NSError - -+ (instancetype)errorWithCode:(SPTErrorCode)code; - -+ (instancetype)errorWithCode:(SPTErrorCode)code description:(NSString *)description; - -+ (instancetype)errorWithCode:(SPTErrorCode)code underlyingError:(NSError *)error; - -@end - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTLogin.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTLogin.h deleted file mode 100644 index 611b76a..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTLogin.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _SPOTIFYLOGIN_ -#define _SPOTIFYLOGIN_ - -#import "SPTConfiguration.h" -#import "SPTError.h" -#import "SPTScope.h" -#import "SPTSession.h" -#import "SPTSessionManager.h" - -#endif /* _SPOTIFYLOGIN_ */ diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTMacros.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTMacros.h deleted file mode 100644 index c7b5415..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTMacros.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef SPT_MACROS -#define SPT_MACROS - -#ifdef __cplusplus -#define SPT_EXPORT extern "C" __attribute__((visibility("default"))) -#else -#define SPT_EXPORT extern __attribute__((visibility("default"))) -#endif // __cplusplus - -#define SPT_DEPRECATED(MESSAGE) __attribute__((deprecated(MESSAGE))) -#define SPT_UNAVAILABLE __attribute__((unavailable)) -#define SPT_UNUSED __attribute__((unused)) -#define SPT_UNREACHABLE() __builtin_unreachable() - -#define SPT_INLINE __attribute__((always_inline)) inline -#define SPT_CONST __attribute__((const)) -#define SPT_PURE __attribute__((pure)) - -#define SPT_NONNULL __attribute__((nonnull)) -#define SPT_RETURNS_NONNULL __attribute__((returns_nonnull)) - -#define SPT_EXPECT(EXPR, VAL) __builtin_expect(!!(EXPR), VAL) -#define SPT_LIKELY(EXPR) SPT_EXPECT(EXPR, 1) -#define SPT_UNLIKELY(EXPR) SPT_EXPECT(EXPR, 0) - -#define SPT_MAX_POW2(TYPE_MAX) ((TYPE_MAX >> 1) ^ TYPE_MAX) - -#define SPT_EXPR_OR_ZERO(EXPR) __builtin_choose_expr(SPT_TYPE_IS_VOID(EXPR), 0, (EXPR)) -#define SPT_TYPE_IS_VOID(EXPR) __builtin_types_compatible_p(typeof(EXPR), void) - -/** - Check if the receiver responds to a selector, then send the message, - along with the provided parameters. - - The purpose of this macro, other than to make code less cluttered, is to make - it impossible to accidentally check for a selector but send a different message. - - @param RECEIVER The object to which the message will be sent. - @param RESULT[out] A pointer to which the return value will be assigned. - @param ... 0-4 arguments. - \code{.m} - BOOL result = NO; - SPT_OPTIONAL_MESSAGE_SEND(self.delegate, &result, someThingie, self, didSomethingWith, someObject); - // Expands to the following: - do { - if ([self.delegate respondsToSelector:@selector(someThingie:didSomethingWith:)]) - *(result) = [self.delegate someThingie:self didSomethingWith:someObject)]; - } while (0); - \endcode -*/ -#define SPT_OPTIONAL_MESSAGE_SEND(RECEIVER, RESULT, ...) do { \ - if ([RECEIVER respondsToSelector:@selector(SPT_CONCAT_SELECTOR(__VA_ARGS__))]) \ - *(RESULT) = [RECEIVER SPT_CONCAT_METHOD(__VA_ARGS__)]; \ -} while (0) - -/** - Like SPT_OPTIONAL_MESSAGE_SEND but ignores the return value. - @param RECEIVER The object to which the message will be sent. - @param ... 0-4 arguments. -*/ -#define SPT_OPTIONAL_MESSAGE_SEND_(RECEIVER, ...) do { \ - if ([RECEIVER respondsToSelector:@selector(SPT_CONCAT_SELECTOR(__VA_ARGS__))]) \ - [RECEIVER SPT_CONCAT_METHOD(__VA_ARGS__)]; \ -} while (0) - -// Some boilerplate for SPT_OPTIONAL_MESSAGE_SEND[_] -#define SPT_CONCAT_METHOD8(A, _1, B, _2, C, _3, D, _4) A:_1 B:_2 C:_3 D:_4 -#define SPT_CONCAT_METHOD6(A, _1, B, _2, C, _3) A:_1 B:_2 C:_3 -#define SPT_CONCAT_METHOD4(A, _1, B, _2) A:_1 B:_2 -#define SPT_CONCAT_METHOD2(A, _1) A:_1 -#define SPT_CONCAT_METHOD1(A) A - -#define SPT_CONCAT_SELECTOR8(A, _1, B, _2, C, _3, D, _4) A:B:C:D: -#define SPT_CONCAT_SELECTOR6(A, _1, B, _2, C, _3) A:B:C: -#define SPT_CONCAT_SELECTOR4(A, _1, B, _2) A:B: -#define SPT_CONCAT_SELECTOR2(A, _1) A: -#define SPT_CONCAT_SELECTOR1(A) A - -#define SPT_PICK_CONCAT_MACRO(_1, _2, _3, _4, _5, _6, _7, _8, NAME, ...) NAME - -#define SPT_CONCAT_METHOD(...) SPT_PICK_CONCAT_MACRO(__VA_ARGS__, \ - SPT_CONCAT_METHOD8, SPT_CONCAT_METHOD7, SPT_CONCAT_METHOD6, SPT_CONCAT_METHOD5, \ - SPT_CONCAT_METHOD4, SPT_CONCAT_METHOD3, SPT_CONCAT_METHOD2, SPT_CONCAT_METHOD1)(__VA_ARGS__) - -#define SPT_CONCAT_SELECTOR(...) SPT_PICK_CONCAT_MACRO(__VA_ARGS__, \ - SPT_CONCAT_SELECTOR8, SPT_CONCAT_SELECTOR7, SPT_CONCAT_SELECTOR6, SPT_CONCAT_SELECTOR5, \ - SPT_CONCAT_SELECTOR4, SPT_CONCAT_SELECTOR3, SPT_CONCAT_SELECTOR2, SPT_CONCAT_SELECTOR1)(__VA_ARGS__) - -#endif // SPT_MACROS diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTScope.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTScope.h deleted file mode 100644 index 2712de7..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTScope.h +++ /dev/null @@ -1,71 +0,0 @@ -// (Objective-C identifier, Swift name, string value, bit flag) -#define SPT_SCOPE_LIST \ -SPT_SCOPE(SPTPlaylistReadPrivateScope, playlistReadPrivate, "playlist-read-private", (1 << 0)) \ -SPT_SCOPE(SPTPlaylistReadCollaborativeScope, playlistReadCollaborative, "playlist-read-collaborative", (1 << 1)) \ -SPT_SCOPE(SPTPlaylistModifyPublicScope, playlistModifyPublic, "playlist-modify-public", (1 << 2)) \ -SPT_SCOPE(SPTPlaylistModifyPrivateScope, playlistModifyPrivate, "playlist-modify-private", (1 << 3)) \ -SPT_SCOPE(SPTUserFollowReadScope, userFollowRead, "user-follow-read", (1 << 4)) \ -SPT_SCOPE(SPTUserFollowModifyScope, userFollowModify, "user-follow-modify", (1 << 5)) \ -SPT_SCOPE(SPTUserLibraryReadScope, userLibraryRead, "user-library-read", (1 << 6)) \ -SPT_SCOPE(SPTUserLibraryModifyScope, userLibraryModify, "user-library-modify", (1 << 7)) \ -SPT_SCOPE(SPTUserReadBirthDateScope, userReadBirthDate, "user-read-birthdate", (1 << 8)) \ -SPT_SCOPE(SPTUserReadEmailScope, userReadEmail, "user-read-email", (1 << 9)) \ -SPT_SCOPE(SPTUserReadPrivateScope, userReadPrivate, "user-read-private", (1 << 10)) \ -SPT_SCOPE(SPTUserTopReadScope, userTopRead, "user-top-read", (1 << 11)) \ -SPT_SCOPE(SPTUGCImageUploadScope, ugcImageUpload, "ugc-image-upload", (1 << 12)) \ -SPT_SCOPE(SPTStreamingScope, streaming, "streaming", (1 << 13)) \ -SPT_SCOPE(SPTAppRemoteControlScope, appRemoteControl, "app-remote-control", (1 << 14)) \ -SPT_SCOPE(SPTUserReadPlaybackStateScope, userReadPlaybackState, "user-read-playback-state", (1 << 15)) \ -SPT_SCOPE(SPTUserModifyPlaybackStateScope, userModifyPlaybackState, "user-modify-playback-state", (1 << 16)) \ -SPT_SCOPE(SPTUserReadCurrentlyPlayingScope, userReadCurrentlyPlaying, "user-read-currently-playing", (1 << 17)) \ -SPT_SCOPE(SPTUserReadRecentlyPlayedScope, userReadRecentlyPlayed, "user-read-recently-played", (1 << 18)) \ -SPT_SCOPE(SPTOpenIdScope, openid, "openid", (1 << 19)) - -/** - `SPTScope` represents the OAuth scopes that declare how your app wants to access a user's account. - See https://developer.spotify.com/web-api/using-scopes/ for more information. -*/ -typedef NS_OPTIONS(NSUInteger, SPTScope) -{ - /// Read access to user's private playlists. - SPTPlaylistReadPrivateScope NS_SWIFT_NAME(playlistReadPrivate) = (1 << 0), - /// Include collaborative playlists when requesting a user's playlists. - SPTPlaylistReadCollaborativeScope NS_SWIFT_NAME(playlistReadCollaborative) = (1 << 1), - /// Write access to a user's public playlists. - SPTPlaylistModifyPublicScope NS_SWIFT_NAME(playlistModifyPublic) = (1 << 2), - /// Write access to a user's private playlists. - SPTPlaylistModifyPrivateScope NS_SWIFT_NAME(playlistModifyPrivate) = (1 << 3), - /// Read access to the list of artists and other users that the user follows. - SPTUserFollowReadScope NS_SWIFT_NAME(userFollowRead) = (1 << 4), - /// Write/delete access to the list of artists and other users that the user follows. - SPTUserFollowModifyScope NS_SWIFT_NAME(userFollowModify) = (1 << 5), - /// Read access to a user's "Your Music" library. - SPTUserLibraryReadScope NS_SWIFT_NAME(userLibraryRead) = (1 << 6), - /// Write/delete access to a user's "Your Music" library. - SPTUserLibraryModifyScope NS_SWIFT_NAME(userLibraryModify) = (1 << 7), - /// Read access to the user's birthdate. - SPTUserReadBirthDateScope NS_SWIFT_NAME(userReadBirthDate) = (1 << 8), - /// Read access to user’s email address. - SPTUserReadEmailScope NS_SWIFT_NAME(userReadEmail) = (1 << 9), - /// Read access to user’s subscription details (type of user account). - SPTUserReadPrivateScope NS_SWIFT_NAME(userReadPrivate) = (1 << 10), - /// Read access to a user's top artists and tracks. - SPTUserTopReadScope NS_SWIFT_NAME(userTopRead) = (1 << 11), - /// Upload user generated content images - SPTUGCImageUploadScope NS_SWIFT_NAME(ugcImageUpload) = (1 << 12), - /// Control playback of a Spotify track. - SPTStreamingScope NS_SWIFT_NAME(streaming) = (1 << 13), - /// Use App Remote to control playback in the Spotify app - SPTAppRemoteControlScope NS_SWIFT_NAME(appRemoteControl) = (1 << 14), - /// Read access to a user’s player state. - SPTUserReadPlaybackStateScope NS_SWIFT_NAME(userReadPlaybackState) = (1 << 15), - /// Write access to a user’s playback state - SPTUserModifyPlaybackStateScope NS_SWIFT_NAME(userModifyPlaybackState) = (1 << 16), - /// Read access to a user’s currently playing track - SPTUserReadCurrentlyPlayingScope NS_SWIFT_NAME(userReadCurrentlyPlaying) = (1 << 17), - /// Read access to a user’s currently playing track - SPTUserReadRecentlyPlayedScope NS_SWIFT_NAME(userReadRecentlyPlayed) = (1 << 18), - /// Indicate that the application intends to use OIDC to verify the user's identity - SPTOpenIdScope NS_SWIFT_NAME(openid) = (1 << 19), -}; - diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTSession.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTSession.h deleted file mode 100644 index 6dbe849..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTSession.h +++ /dev/null @@ -1,32 +0,0 @@ -#import "SPTScope.h" - -NS_ASSUME_NONNULL_BEGIN - - -/// The `SPTSession` represents an authenticated Spotify user session. -@interface SPTSession : NSObject - -/// The access token of the authenticated user. -@property (nonatomic, readonly, copy) NSString *accessToken; - -/// The refresh token. -@property (nonatomic, readonly, copy) NSString *refreshToken; - -/// The expiration date of the access token. -@property (nonatomic, readonly, copy) NSDate *expirationDate; - -/// The scope granted. -@property (nonatomic, readonly) SPTScope scope; - -/** - Check whether the session has expired. `YES` if expired; `NO` otherwise. - Note: The session is considered expired once the current date and time is equal to or greater than the expiration date and time. -*/ -@property (nonatomic, readonly, getter=isExpired) BOOL expired; - -- (instancetype)init NS_UNAVAILABLE; - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SPTSessionManager.h b/SpotifyiOS.framework/Versions/Current/Headers/SPTSessionManager.h deleted file mode 100644 index 7f48942..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SPTSessionManager.h +++ /dev/null @@ -1,130 +0,0 @@ -#import -#import "SPTScope.h" - -NS_ASSUME_NONNULL_BEGIN - -@class SPTConfiguration, SPTSession; -@protocol SPTSessionManagerDelegate; - -/// Options for determining the most suitable method for authorization -typedef NS_OPTIONS(NSUInteger, SPTAuthorizationOptions) -{ - /// Authorize using a suitable method. If Spotify is installed the app will be used instead of a web view - SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0), - /// Authorize using only the Spotify client. If Spotify is not installed authorization will fail. - SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0), -} NS_SWIFT_NAME(AuthorizationOptions); - -typedef NSString * const SPTAuthorizationCode; - - -/// This class manages a Spotify user session, in the form of `SPTSession`. -@interface SPTSessionManager : NSObject - -/// The `SPTSession` for the `SPTSessionManager` to manage. If no user has been authenticated this will be nil -@property (nullable, nonatomic, strong) SPTSession *session; - -/// The `SPTSessionManagerDelegate` to notify of initiating a session, renewing a session, and/or errors related to a session -@property (nullable, nonatomic, weak) id delegate; - -/** - Determine if the Spotify app is installed. - - Will be `YES` if the Spotify app is installed (and the URL scheme is whitelisted), otherwise is `NO`. - Note: You must whitelist the "spotify" URL scheme in your info.plist LSApplicationQueriesSchemes or this will always be NO - */ -@property (nonatomic, readonly, getter=isSpotifyAppInstalled) BOOL spotifyAppInstalled; - -/** - Set this value to `YES` when debugging to have the Spotify app always show the authorization confirmation screen. - You SHOULD NOT set this value to `YES` in production or your users will always have to confirm. - */ -@property (nonatomic, assign) BOOL alwaysShowAuthorizationDialog; - -- (instancetype)init NS_UNAVAILABLE; - -/** - Initiate the authorization process - - @param scope The scope to request, e.g. `SPTPlaylistReadPrivateScope`|`SPTUserReadEmailScope` if you wish to request read access to private playlists, and read access to the user's email address. - @param options Options bitmask that informs authorization behavior. - @param campaign The campaign identifier, to help attribute where the account linking was initiated from. - See `SPTSessionManagerDelegate` for messages regarding changes in session state. - */ -- (void)initiateSessionWithScope:(SPTScope)scope - options:(SPTAuthorizationOptions)options - campaign:(nullable NSString *)campaign; - -/// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid. -- (void)renewSession; - -/** - Create an `SPTSessionManager` with the provided configuration. - - @param configuration An `SPTConfiguration` object. - @param delegate An optional delegate conforming to `SPTSessionManagerDelegate`. - @return An `SPTSessionManager` with the desired configuration. -*/ -- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration - delegate:(nullable id )delegate; - -+ (instancetype)sessionManagerWithConfiguration:(SPTConfiguration *)configuration - delegate:(nullable id )delegate; -/** - Handle openURL callbacks from the `AppDelegate` - - @param application The `UIApplication` passed into the matching `AppDelegate` method - @param URL The URL to attempt to parse the access token from - @param options The options passed in to the matching `AppDelegate` method - @return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`. -*/ -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)URL - options:(NSDictionary *)options; - -@end - -/// The `SPTSessionManagerDelegate` to use for monitoring state changes of a `SPTSessionManager` -@protocol SPTSessionManagerDelegate - -/** - This message is sent when a session has been initiated successfully. - - @param manager The `SPTSessionManager` that initiated the session. - @param session The initiated `SPTSession` object. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didInitiateSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didInitiate:)); - -/** - This message is sent when the manager failed to initiate or renew a session. - - @param manager The `SPTSessionManager` instance. - @param error The `NSError` that occured. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didFailWithError:(NSError *)error NS_SWIFT_NAME(sessionManager(manager:didFailWith:)); - -@optional - -/** - This message is sent when the manager has renewed a session. - - @param manager The `SPTSessionManager` instance. - @param session The renewed `SPTSession` object. -*/ -- (void)sessionManager:(SPTSessionManager *)manager didRenewSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didRenew:)); - -/** - Sent when the `SPTSessionManager` has obtained an authorization code, - and is about to swap it for an access token. If you wish to handle this - yourself, return `NO` and use the provided authorization code. - - @param manager The `SPTSessionManager` instance. - @param code An OAuth authorization code. - @return `NO` to request the access token yourself; `YES` to let `SPTSessionManager` handle it. -*/ -- (BOOL)sessionManager:(SPTSessionManager *)manager shouldRequestAccessTokenWithAuthorizationCode:(SPTAuthorizationCode)code NS_SWIFT_NAME(sessionManager(manager:shouldRequestAccessTokenWith:)); - -@end - - -NS_ASSUME_NONNULL_END diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SpotifyAppRemote.h b/SpotifyiOS.framework/Versions/Current/Headers/SpotifyAppRemote.h deleted file mode 100644 index 5383aa5..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SpotifyAppRemote.h +++ /dev/null @@ -1,32 +0,0 @@ -#import - -#ifndef _SPOTIFYAPPREMOTE_ -#define _SPOTIFYAPPREMOTE_ - -#import "SPTAppRemote.h" -#import "SPTAppRemoteCommon.h" - -#import "SPTAppRemoteConnectionParams.h" - -#import "SPTAppRemoteImageAPI.h" -#import "SPTAppRemotePlayerAPI.h" -#import "SPTAppRemoteUserAPI.h" -#import "SPTAppRemoteContentAPI.h" - -#import "SPTAppRemoteAlbum.h" -#import "SPTAppRemoteArtist.h" -#import "SPTAppRemotePlaybackOptions.h" -#import "SPTAppRemotePlaybackRestrictions.h" -#import "SPTAppRemotePlayerState.h" -#import "SPTAppRemoteCrossfadeState.h" -#import "SPTAppRemoteTrack.h" -#import "SPTAppRemoteUserCapabilities.h" -#import "SPTAppRemoteLibraryState.h" -#import "SPTAppRemoteContentItem.h" -#import "SPTAppRemotePodcastPlaybackSpeed.h" -#import "SPTAppRemoteConnectivityAPI.h" -#import "SPTAppRemoteConnectivityState.h" - -#import "SPTConfiguration.h" - -#endif /* _SPOTIFYAPPREMOTE_ */ diff --git a/SpotifyiOS.framework/Versions/Current/Headers/SpotifyiOS.h b/SpotifyiOS.framework/Versions/Current/Headers/SpotifyiOS.h deleted file mode 100644 index cb1bef2..0000000 --- a/SpotifyiOS.framework/Versions/Current/Headers/SpotifyiOS.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _SPOTIFYIOS_ -#define _SPOTIFYIOS_ - -#import "SpotifyAppRemote.h" -#import "SPTLogin.h" - -#endif /* _SPOTIFYIOS_ */ diff --git a/SpotifyiOS.framework/Versions/Current/SpotifyiOS b/SpotifyiOS.framework/Versions/Current/SpotifyiOS deleted file mode 100644 index dafecbb..0000000 Binary files a/SpotifyiOS.framework/Versions/Current/SpotifyiOS and /dev/null differ diff --git a/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist b/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist index cea8629..07fc540 100644 Binary files a/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist and b/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist differ diff --git a/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS b/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS index 9f5f4a9..f1a0454 100755 Binary files a/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS and b/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS differ diff --git a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist index 8406b66..1dddb23 100644 Binary files a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist and b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist differ diff --git a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS index ea5652c..b882088 100755 Binary files a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS and b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS differ diff --git a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources index 4414a13..5d54566 100644 --- a/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +++ b/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources @@ -126,7 +126,7 @@ Info.plist - dIQEPuwCF05rSz5+JYQt/ZYEQ/8= + 2XKlaI2O004Ut/2EzZfjbJ0N954= Modules/module.modulemap diff --git a/docs/html/Blocks/SPTAppRemoteCallback.html b/docs/html/Blocks/SPTAppRemoteCallback.html index 864a07e..33f63d3 100644 --- a/docs/html/Blocks/SPTAppRemoteCallback.html +++ b/docs/html/Blocks/SPTAppRemoteCallback.html @@ -112,7 +112,7 @@

Declared In