@wwdrew/expo-spotify-sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -3
- package/build/ExpoSpotifySDK.types.d.ts +0 -2
- package/build/ExpoSpotifySDK.types.d.ts.map +1 -1
- package/build/ExpoSpotifySDK.types.js.map +1 -1
- package/external/android/SpotifySDK/auth-lib/spotify-auth-release-2.1.0.aar +0 -0
- package/ios/ExpoSpotifySDKModule.swift +14 -22
- package/ios/ExpoSpotifySessionManager+SessionManagerDelegate.swift +2 -12
- package/ios/ExpoSpotifySessionManager.swift +24 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/Info.plist +9 -5
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemote.h +14 -10
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +3 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSessionManager.h +3 -13
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +2 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Modules/module.modulemap +1 -1
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/PrivacyInfo.xcprivacy +14 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +14 -10
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +3 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +3 -13
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +2 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +1 -1
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/PrivacyInfo.xcprivacy +14 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +20 -133
- package/package.json +4 -3
- package/plugin/build/android/withSpotifyAndroidAppBuildGradle.js +18 -2
- package/plugin/build/index.js +2 -2
- package/plugin/build/ios/{withSpotifyConfigIOS.d.ts → withSpotifyConfigValues.d.ts} +1 -1
- package/plugin/build/ios/{withSpotifyConfigIOS.js → withSpotifyConfigValues.js} +3 -3
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -240
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -36
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -75
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -43
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -262
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -47
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -103
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -63
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTError.h +0 -33
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTMacros.h +0 -89
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTScope.h +0 -68
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSession.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -140
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -30
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Modules/module.modulemap +0 -6
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -240
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -36
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -75
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -43
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -262
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -47
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -103
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -63
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +0 -33
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTMacros.h +0 -89
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +0 -68
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSession.h +0 -32
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -140
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -30
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +0 -6
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +0 -537
- package/plugin/build/android/withSpotifyConfigAndroid.d.ts +0 -3
- package/plugin/build/android/withSpotifyConfigAndroid.js +0 -16
- package/plugin/build/withSpotifyConfig.d.ts +0 -3
- package/plugin/build/withSpotifyConfig.js +0 -11
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// (Objective-C identifier, Swift name, string value, bit flag)
|
|
2
|
-
#define SPT_SCOPE_LIST \
|
|
3
|
-
SPT_SCOPE(SPTPlaylistReadPrivateScope, playlistReadPrivate, "playlist-read-private", (1 << 0)) \
|
|
4
|
-
SPT_SCOPE(SPTPlaylistReadCollaborativeScope, playlistReadCollaborative, "playlist-read-collaborative", (1 << 1)) \
|
|
5
|
-
SPT_SCOPE(SPTPlaylistModifyPublicScope, playlistModifyPublic, "playlist-modify-public", (1 << 2)) \
|
|
6
|
-
SPT_SCOPE(SPTPlaylistModifyPrivateScope, playlistModifyPrivate, "playlist-modify-private", (1 << 3)) \
|
|
7
|
-
SPT_SCOPE(SPTUserFollowReadScope, userFollowRead, "user-follow-read", (1 << 4)) \
|
|
8
|
-
SPT_SCOPE(SPTUserFollowModifyScope, userFollowModify, "user-follow-modify", (1 << 5)) \
|
|
9
|
-
SPT_SCOPE(SPTUserLibraryReadScope, userLibraryRead, "user-library-read", (1 << 6)) \
|
|
10
|
-
SPT_SCOPE(SPTUserLibraryModifyScope, userLibraryModify, "user-library-modify", (1 << 7)) \
|
|
11
|
-
SPT_SCOPE(SPTUserReadBirthDateScope, userReadBirthDate, "user-read-birthdate", (1 << 8)) \
|
|
12
|
-
SPT_SCOPE(SPTUserReadEmailScope, userReadEmail, "user-read-email", (1 << 9)) \
|
|
13
|
-
SPT_SCOPE(SPTUserReadPrivateScope, userReadPrivate, "user-read-private", (1 << 10)) \
|
|
14
|
-
SPT_SCOPE(SPTUserTopReadScope, userTopRead, "user-top-read", (1 << 11)) \
|
|
15
|
-
SPT_SCOPE(SPTUGCImageUploadScope, ugcImageUpload, "ugc-image-upload", (1 << 12)) \
|
|
16
|
-
SPT_SCOPE(SPTStreamingScope, streaming, "streaming", (1 << 13)) \
|
|
17
|
-
SPT_SCOPE(SPTAppRemoteControlScope, appRemoteControl, "app-remote-control", (1 << 14)) \
|
|
18
|
-
SPT_SCOPE(SPTUserReadPlaybackStateScope, userReadPlaybackState, "user-read-playback-state", (1 << 15)) \
|
|
19
|
-
SPT_SCOPE(SPTUserModifyPlaybackStateScope, userModifyPlaybackState, "user-modify-playback-state", (1 << 16)) \
|
|
20
|
-
SPT_SCOPE(SPTUserReadCurrentlyPlayingScope, userReadCurrentlyPlaying, "user-read-currently-playing", (1 << 17)) \
|
|
21
|
-
SPT_SCOPE(SPTUserReadRecentlyPlayedScope, userReadRecentlyPlayed, "user-read-recently-played", (1 << 18))
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
`SPTScope` represents the OAuth scopes that declare how your app wants to access a user's account.
|
|
25
|
-
See https://developer.spotify.com/web-api/using-scopes/ for more information.
|
|
26
|
-
*/
|
|
27
|
-
typedef NS_OPTIONS(NSUInteger, SPTScope)
|
|
28
|
-
{
|
|
29
|
-
/// Read access to user's private playlists.
|
|
30
|
-
SPTPlaylistReadPrivateScope NS_SWIFT_NAME(playlistReadPrivate) = (1 << 0),
|
|
31
|
-
/// Include collaborative playlists when requesting a user's playlists.
|
|
32
|
-
SPTPlaylistReadCollaborativeScope NS_SWIFT_NAME(playlistReadCollaborative) = (1 << 1),
|
|
33
|
-
/// Write access to a user's public playlists.
|
|
34
|
-
SPTPlaylistModifyPublicScope NS_SWIFT_NAME(playlistModifyPublic) = (1 << 2),
|
|
35
|
-
/// Write access to a user's private playlists.
|
|
36
|
-
SPTPlaylistModifyPrivateScope NS_SWIFT_NAME(playlistModifyPrivate) = (1 << 3),
|
|
37
|
-
/// Read access to the list of artists and other users that the user follows.
|
|
38
|
-
SPTUserFollowReadScope NS_SWIFT_NAME(userFollowRead) = (1 << 4),
|
|
39
|
-
/// Write/delete access to the list of artists and other users that the user follows.
|
|
40
|
-
SPTUserFollowModifyScope NS_SWIFT_NAME(userFollowModify) = (1 << 5),
|
|
41
|
-
/// Read access to a user's "Your Music" library.
|
|
42
|
-
SPTUserLibraryReadScope NS_SWIFT_NAME(userLibraryRead) = (1 << 6),
|
|
43
|
-
/// Write/delete access to a user's "Your Music" library.
|
|
44
|
-
SPTUserLibraryModifyScope NS_SWIFT_NAME(userLibraryModify) = (1 << 7),
|
|
45
|
-
/// Read access to the user's birthdate.
|
|
46
|
-
SPTUserReadBirthDateScope NS_SWIFT_NAME(userReadBirthDate) = (1 << 8),
|
|
47
|
-
/// Read access to user’s email address.
|
|
48
|
-
SPTUserReadEmailScope NS_SWIFT_NAME(userReadEmail) = (1 << 9),
|
|
49
|
-
/// Read access to user’s subscription details (type of user account).
|
|
50
|
-
SPTUserReadPrivateScope NS_SWIFT_NAME(userReadPrivate) = (1 << 10),
|
|
51
|
-
/// Read access to a user's top artists and tracks.
|
|
52
|
-
SPTUserTopReadScope NS_SWIFT_NAME(userTopRead) = (1 << 11),
|
|
53
|
-
/// Upload user generated content images
|
|
54
|
-
SPTUGCImageUploadScope NS_SWIFT_NAME(ugcImageUpload) = (1 << 12),
|
|
55
|
-
/// Control playback of a Spotify track.
|
|
56
|
-
SPTStreamingScope NS_SWIFT_NAME(streaming) = (1 << 13),
|
|
57
|
-
/// Use App Remote to control playback in the Spotify app
|
|
58
|
-
SPTAppRemoteControlScope NS_SWIFT_NAME(appRemoteControl) = (1 << 14),
|
|
59
|
-
/// Read access to a user’s player state.
|
|
60
|
-
SPTUserReadPlaybackStateScope NS_SWIFT_NAME(userReadPlaybackState) = (1 << 15),
|
|
61
|
-
/// Write access to a user’s playback state
|
|
62
|
-
SPTUserModifyPlaybackStateScope NS_SWIFT_NAME(userModifyPlaybackState) = (1 << 16),
|
|
63
|
-
/// Read access to a user’s currently playing track
|
|
64
|
-
SPTUserReadCurrentlyPlayingScope NS_SWIFT_NAME(userReadCurrentlyPlaying) = (1 << 17),
|
|
65
|
-
/// Read access to a user’s currently playing track
|
|
66
|
-
SPTUserReadRecentlyPlayedScope NS_SWIFT_NAME(userReadRecentlyPlayed) = (1 << 18),
|
|
67
|
-
};
|
|
68
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
#import "SPTScope.h"
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/// The `SPTSession` represents an authenticated Spotify user session.
|
|
7
|
-
@interface SPTSession : NSObject <NSSecureCoding>
|
|
8
|
-
|
|
9
|
-
/// The access token of the authenticated user.
|
|
10
|
-
@property (nonatomic, readonly, copy) NSString *accessToken;
|
|
11
|
-
|
|
12
|
-
/// The refresh token.
|
|
13
|
-
@property (nonatomic, readonly, copy) NSString *refreshToken;
|
|
14
|
-
|
|
15
|
-
/// The expiration date of the access token.
|
|
16
|
-
@property (nonatomic, readonly, copy) NSDate *expirationDate;
|
|
17
|
-
|
|
18
|
-
/// The scope granted.
|
|
19
|
-
@property (nonatomic, readonly) SPTScope scope;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
Check whether the session has expired. `YES` if expired; `NO` otherwise.
|
|
23
|
-
Note: The session is considered expired once the current date and time is equal to or greater than the expiration date and time.
|
|
24
|
-
*/
|
|
25
|
-
@property (nonatomic, readonly, getter=isExpired) BOOL expired;
|
|
26
|
-
|
|
27
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
28
|
-
|
|
29
|
-
@end
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
#import "SPTScope.h"
|
|
3
|
-
|
|
4
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
5
|
-
|
|
6
|
-
@class SPTConfiguration, SPTSession;
|
|
7
|
-
@protocol SPTSessionManagerDelegate;
|
|
8
|
-
|
|
9
|
-
/// Options for determining the most suitable method for authorization
|
|
10
|
-
typedef NS_OPTIONS(NSUInteger, SPTAuthorizationOptions)
|
|
11
|
-
{
|
|
12
|
-
/// Authorize using a suitable method. If Spotify is installed the app will be used instead of a web view
|
|
13
|
-
SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0),
|
|
14
|
-
/// Authorize using only the Spotify client. If Spotify is not installed authorization will fail.
|
|
15
|
-
SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0),
|
|
16
|
-
} NS_SWIFT_NAME(AuthorizationOptions);
|
|
17
|
-
|
|
18
|
-
typedef NSString * const SPTAuthorizationCode;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/// This class manages a Spotify user session, in the form of `SPTSession`.
|
|
22
|
-
@interface SPTSessionManager : NSObject
|
|
23
|
-
|
|
24
|
-
/// The `SPTSession` for the `SPTSessionManager` to manage. If no user has been authenticated this will be nil
|
|
25
|
-
@property (nullable, nonatomic, strong) SPTSession *session;
|
|
26
|
-
|
|
27
|
-
/// The `SPTSessionManagerDelegate` to notify of initiating a session, renewing a session, and/or errors related to a session
|
|
28
|
-
@property (nullable, nonatomic, weak) id <SPTSessionManagerDelegate> delegate;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
Determine if the Spotify app is installed.
|
|
32
|
-
|
|
33
|
-
Will be `YES` if the Spotify app is installed (and the URL scheme is whitelisted), otherwise is `NO`.
|
|
34
|
-
Note: You must whitelist the "spotify" URL scheme in your info.plist LSApplicationQueriesSchemes or this will always be NO
|
|
35
|
-
*/
|
|
36
|
-
@property (nonatomic, readonly, getter=isSpotifyAppInstalled) BOOL spotifyAppInstalled;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
Set this value to `YES` when debugging to have the Spotify app always show the authorization confirmation screen.
|
|
40
|
-
You SHOULD NOT set this value to `YES` in production or your users will always have to confirm.
|
|
41
|
-
*/
|
|
42
|
-
@property (nonatomic, assign) BOOL alwaysShowAuthorizationDialog;
|
|
43
|
-
|
|
44
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
Initiate the authorization process on iOS 11 and later.
|
|
48
|
-
|
|
49
|
-
@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.
|
|
50
|
-
@param options Options bitmask that informs authorization behavior.
|
|
51
|
-
See `SPTSessionManagerDelegate` for messages regarding changes in session state.
|
|
52
|
-
*/
|
|
53
|
-
- (void)initiateSessionWithScope:(SPTScope)scope
|
|
54
|
-
options:(SPTAuthorizationOptions)options NS_AVAILABLE_IOS(11_0);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
Initiate the authorization process on iOS versions < 11.
|
|
58
|
-
|
|
59
|
-
@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.
|
|
60
|
-
@param options Options bitmask that informs authorization behavior.
|
|
61
|
-
@param presentingViewController The `UIViewController` to present the login `SFSafariViewController` on
|
|
62
|
-
See `SPTSessionManagerDelegate` for messages regarding changes in session state.
|
|
63
|
-
*/
|
|
64
|
-
- (void)initiateSessionWithScope:(SPTScope)scope
|
|
65
|
-
options:(SPTAuthorizationOptions)options
|
|
66
|
-
presentingViewController: (UIViewController *)presentingViewController NS_DEPRECATED_IOS(9_0, 11_0);
|
|
67
|
-
|
|
68
|
-
/// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid.
|
|
69
|
-
- (void)renewSession;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
Create an `SPTSessionManager` with the provided configuration.
|
|
73
|
-
|
|
74
|
-
@param configuration An `SPTConfiguration` object.
|
|
75
|
-
@param delegate An optional delegate conforming to `SPTSessionManagerDelegate`.
|
|
76
|
-
@return An `SPTSessionManager` with the desired configuration.
|
|
77
|
-
*/
|
|
78
|
-
- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration
|
|
79
|
-
delegate:(nullable id <SPTSessionManagerDelegate>)delegate;
|
|
80
|
-
|
|
81
|
-
+ (instancetype)sessionManagerWithConfiguration:(SPTConfiguration *)configuration
|
|
82
|
-
delegate:(nullable id <SPTSessionManagerDelegate>)delegate;
|
|
83
|
-
/**
|
|
84
|
-
Handle openURL callbacks from the `AppDelegate`
|
|
85
|
-
|
|
86
|
-
@param application The `UIApplication` passed into the matching `AppDelegate` method
|
|
87
|
-
@param URL The URL to attempt to parse the access token from
|
|
88
|
-
@param options The options passed in to the matching `AppDelegate` method
|
|
89
|
-
@return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise returns `NO`.
|
|
90
|
-
*/
|
|
91
|
-
- (BOOL)application:(UIApplication *)application
|
|
92
|
-
openURL:(NSURL *)URL
|
|
93
|
-
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
|
|
94
|
-
|
|
95
|
-
@end
|
|
96
|
-
|
|
97
|
-
/// The `SPTSessionManagerDelegate` to use for monitoring state changes of a `SPTSessionManager`
|
|
98
|
-
@protocol SPTSessionManagerDelegate <NSObject>
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
This message is sent when a session has been initiated successfully.
|
|
102
|
-
|
|
103
|
-
@param manager The `SPTSessionManager` that initiated the session.
|
|
104
|
-
@param session The initiated `SPTSession` object.
|
|
105
|
-
*/
|
|
106
|
-
- (void)sessionManager:(SPTSessionManager *)manager didInitiateSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didInitiate:));
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
This message is sent when the manager failed to initiate or renew a session.
|
|
110
|
-
|
|
111
|
-
@param manager The `SPTSessionManager` instance.
|
|
112
|
-
@param error The `NSError` that occured.
|
|
113
|
-
*/
|
|
114
|
-
- (void)sessionManager:(SPTSessionManager *)manager didFailWithError:(NSError *)error NS_SWIFT_NAME(sessionManager(manager:didFailWith:));
|
|
115
|
-
|
|
116
|
-
@optional
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
This message is sent when the manager has renewed a session.
|
|
120
|
-
|
|
121
|
-
@param manager The `SPTSessionManager` instance.
|
|
122
|
-
@param session The renewed `SPTSession` object.
|
|
123
|
-
*/
|
|
124
|
-
- (void)sessionManager:(SPTSessionManager *)manager didRenewSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didRenew:));
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
Sent when the `SPTSessionManager` has obtained an authorization code,
|
|
128
|
-
and is about to swap it for an access token. If you wish to handle this
|
|
129
|
-
yourself, return `NO` and use the provided authorization code.
|
|
130
|
-
|
|
131
|
-
@param manager The `SPTSessionManager` instance.
|
|
132
|
-
@param code An OAuth authorization code.
|
|
133
|
-
@return `NO` to request the access token yourself; `YES` to let `SPTSessionManager` handle it.
|
|
134
|
-
*/
|
|
135
|
-
- (BOOL)sessionManager:(SPTSessionManager *)manager shouldRequestAccessTokenWithAuthorizationCode:(SPTAuthorizationCode)code NS_SWIFT_NAME(sessionManager(manager:shouldRequestAccessTokenWith:));
|
|
136
|
-
|
|
137
|
-
@end
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
#ifndef _SPOTIFYAPPREMOTE_
|
|
4
|
-
#define _SPOTIFYAPPREMOTE_
|
|
5
|
-
|
|
6
|
-
#import "SPTAppRemote.h"
|
|
7
|
-
#import "SPTAppRemoteCommon.h"
|
|
8
|
-
|
|
9
|
-
#import "SPTAppRemoteConnectionParams.h"
|
|
10
|
-
|
|
11
|
-
#import "SPTAppRemoteImageAPI.h"
|
|
12
|
-
#import "SPTAppRemotePlayerAPI.h"
|
|
13
|
-
#import "SPTAppRemoteUserAPI.h"
|
|
14
|
-
#import "SPTAppRemoteContentAPI.h"
|
|
15
|
-
|
|
16
|
-
#import "SPTAppRemoteAlbum.h"
|
|
17
|
-
#import "SPTAppRemoteArtist.h"
|
|
18
|
-
#import "SPTAppRemotePlaybackOptions.h"
|
|
19
|
-
#import "SPTAppRemotePlaybackRestrictions.h"
|
|
20
|
-
#import "SPTAppRemotePlayerState.h"
|
|
21
|
-
#import "SPTAppRemoteCrossfadeState.h"
|
|
22
|
-
#import "SPTAppRemoteTrack.h"
|
|
23
|
-
#import "SPTAppRemoteUserCapabilities.h"
|
|
24
|
-
#import "SPTAppRemoteLibraryState.h"
|
|
25
|
-
#import "SPTAppRemoteContentItem.h"
|
|
26
|
-
#import "SPTAppRemotePodcastPlaybackSpeed.h"
|
|
27
|
-
|
|
28
|
-
#import "SPTConfiguration.h"
|
|
29
|
-
|
|
30
|
-
#endif /* _SPOTIFYAPPREMOTE_ */
|
package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Info.plist
DELETED
|
Binary file
|
package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/SpotifyiOS
DELETED
|
Binary file
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
@class SPTAppRemote;
|
|
4
|
-
@class SPTAppRemoteConnectionParams;
|
|
5
|
-
@class SPTConfiguration;
|
|
6
|
-
|
|
7
|
-
@protocol SPTAppRemoteImageAPI;
|
|
8
|
-
@protocol SPTAppRemotePlayerAPI;
|
|
9
|
-
@protocol SPTAppRemoteUserAPI;
|
|
10
|
-
@protocol SPTAppRemoteContentAPI;
|
|
11
|
-
|
|
12
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
-
|
|
14
|
-
extern NSString * const SPTAppRemoteAccessTokenKey;
|
|
15
|
-
extern NSString * const SPTAppRemoteErrorDescriptionKey;
|
|
16
|
-
|
|
17
|
-
/// The severity of log messages that the App Remote should log to console.
|
|
18
|
-
typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
|
|
19
|
-
/// Do not log at all.
|
|
20
|
-
SPTAppRemoteLogLevelNone = 0,
|
|
21
|
-
/// Log debug, info and error messages.
|
|
22
|
-
SPTAppRemoteLogLevelDebug = 1,
|
|
23
|
-
/// Log info and error messages.
|
|
24
|
-
SPTAppRemoteLogLevelInfo = 2,
|
|
25
|
-
/// Log only error messages.
|
|
26
|
-
SPTAppRemoteLogLevelError = 3,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The `SPTAppRemoteDelegate` receives updates from the `SPTAppRemote` whenever something has
|
|
31
|
-
* happened with the connection.
|
|
32
|
-
*/
|
|
33
|
-
@protocol SPTAppRemoteDelegate <NSObject>
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Called when the App Remote has established connection with the Spotify app.
|
|
37
|
-
*
|
|
38
|
-
* @param appRemote The transport that has connected.
|
|
39
|
-
*/
|
|
40
|
-
- (void)appRemoteDidEstablishConnection:(SPTAppRemote *)appRemote;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Called when the connection attempt made by the App Remote failed.
|
|
44
|
-
*
|
|
45
|
-
* @param appRemote The App Remote that failed to connect.
|
|
46
|
-
* @param error The error that occurred.
|
|
47
|
-
*/
|
|
48
|
-
- (void)appRemote:(SPTAppRemote *)appRemote didFailConnectionAttemptWithError:(nullable NSError *)error;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Called when the App Remote has disconnected.
|
|
52
|
-
*
|
|
53
|
-
* @note All APIs will be released by the App Remote at this point. The will no longer be usable,
|
|
54
|
-
* and so you should release them as well.
|
|
55
|
-
*
|
|
56
|
-
* @param appRemote The App Remote that disconnected.
|
|
57
|
-
* @param error The error that caused the disconnect, or `nil` if the disconnect was explicit.
|
|
58
|
-
*/
|
|
59
|
-
- (void)appRemote:(SPTAppRemote *)appRemote didDisconnectWithError:(nullable NSError *)error;
|
|
60
|
-
|
|
61
|
-
@end
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* The `SPTAppRemote` is the main entry point for interacting with the Spotify app using the Spotify App Remote for iOS.
|
|
65
|
-
*/
|
|
66
|
-
@interface SPTAppRemote : NSObject
|
|
67
|
-
|
|
68
|
-
#pragma mark Lifecycle
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Convenience Initializer for a new App Remote instance
|
|
72
|
-
*
|
|
73
|
-
* @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs
|
|
74
|
-
* @param logLevel The lowest severity to log to console.
|
|
75
|
-
*
|
|
76
|
-
* @return A fresh new App Remote, ready to connect.
|
|
77
|
-
*/
|
|
78
|
-
- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration logLevel:(SPTAppRemoteLogLevel)logLevel;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Designated Initializer for a new App Remote instance
|
|
82
|
-
*
|
|
83
|
-
* @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs
|
|
84
|
-
* @param connectionParameters `SPTAppRemoteConnectionParams` for custom image sizes and types, and to hold the accessToken
|
|
85
|
-
* @param logLevel The lowest severity to log to console.
|
|
86
|
-
*
|
|
87
|
-
* @return A fresh new App Remote, ready to connect.
|
|
88
|
-
*/
|
|
89
|
-
- (instancetype)initWithConfiguration:(SPTConfiguration *)configuration
|
|
90
|
-
connectionParameters:(SPTAppRemoteConnectionParams *)connectionParameters
|
|
91
|
-
logLevel:(SPTAppRemoteLogLevel)logLevel NS_DESIGNATED_INITIALIZER;
|
|
92
|
-
#pragma mark Class Methods
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Checks if the Spotify app is active on the user's device. You can use this to determine if maybe you should prompt
|
|
96
|
-
* the user to connect to Spotify (because you know they are already using Spotify if it is active). The Spotify app
|
|
97
|
-
* will be considered active if music is playing or the app is active in the background.
|
|
98
|
-
*
|
|
99
|
-
* @param completion Completion block for determining the result of the check. YES if Spotify is active, othewise NO.
|
|
100
|
-
*/
|
|
101
|
-
+ (void)checkIfSpotifyAppIsActive:(void (^)(BOOL active))completion;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Determine the current version of the Spotify App Remote
|
|
105
|
-
*
|
|
106
|
-
* @return The current version of the Spotify App Remote
|
|
107
|
-
*/
|
|
108
|
-
+ (NSString *)appRemoteVersion;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* The Spotify app iTunes item identifier for use with `SKStoreProductViewController` for installing Spotify from the App Store.
|
|
112
|
-
*
|
|
113
|
-
* @return An `NSNumber` representing the Spotify iTunes item identifier to be used for the `SKStoreProductParameterITunesItemIdentifier` key
|
|
114
|
-
*/
|
|
115
|
-
+ (NSNumber *)spotifyItunesItemIdentifier;
|
|
116
|
-
|
|
117
|
-
#pragma mark Connection
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The parameters to use during connection.
|
|
121
|
-
*/
|
|
122
|
-
@property (nonatomic, strong, readonly) SPTAppRemoteConnectionParams *connectionParameters;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* `YES` if the App Remote is connected to the Spotify application, otherwise `NO`.
|
|
126
|
-
*
|
|
127
|
-
* @note Not KVO’able.
|
|
128
|
-
*
|
|
129
|
-
* See The `SPTAppRemoteDelegate` in order to receive updates when the connection status changes.
|
|
130
|
-
*/
|
|
131
|
-
@property (nonatomic, assign, readonly, getter=isConnected) BOOL connected;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* The delegate to notify for connection status changes and other events originating from the App Remote.
|
|
135
|
-
*/
|
|
136
|
-
@property (nonatomic, weak) id<SPTAppRemoteDelegate> delegate;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Attempts to connect to the Spotify application.
|
|
140
|
-
*
|
|
141
|
-
* @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up
|
|
142
|
-
*/
|
|
143
|
-
- (void)connect;
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Disconnect from the Spotify application
|
|
147
|
-
*/
|
|
148
|
-
- (void)disconnect;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Open Spotify app to obtain access token and start playback.
|
|
152
|
-
*
|
|
153
|
-
* @param URI The URI to play. Use a blank string to attempt to play the user's last song
|
|
154
|
-
*
|
|
155
|
-
* @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
|
|
156
|
-
* Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
|
|
157
|
-
* the Spotify app is installed and can attempt to handle the authorization request.
|
|
158
|
-
*/
|
|
159
|
-
- (BOOL)authorizeAndPlayURI:(NSString *)URI;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Open Spotify app to obtain access token and start playback.
|
|
163
|
-
*
|
|
164
|
-
* @param playURI The URI to play. Use a blank string to attempt to play the user's last song
|
|
165
|
-
* @param asRadio `YES` to start radio for the given URI.
|
|
166
|
-
*
|
|
167
|
-
* @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
|
|
168
|
-
* Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
|
|
169
|
-
* the Spotify app is installed and can attempt to handle the authorization request.
|
|
170
|
-
*/
|
|
171
|
-
- (BOOL)authorizeAndPlayURI:(NSString *)playURI asRadio:(BOOL)asRadio;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Open Spotify app to obtain access token and start playback.
|
|
175
|
-
*
|
|
176
|
-
* @param playURI The URI to play. Use a blank string to attempt to play the user's last song
|
|
177
|
-
* @param asRadio `YES` to start radio for the given URI.
|
|
178
|
-
* @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control`
|
|
179
|
-
*
|
|
180
|
-
* @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
|
|
181
|
-
* Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
|
|
182
|
-
* the Spotify app is installed and can attempt to handle the authorization request.
|
|
183
|
-
*/
|
|
184
|
-
- (BOOL)authorizeAndPlayURI:(NSString *)playURI
|
|
185
|
-
asRadio:(BOOL)asRadio
|
|
186
|
-
additionalScopes:(nullable NSArray<NSString *> *)additionalScopes;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Parse out an access token or error description from a url passed to application:openURL:options:
|
|
190
|
-
*
|
|
191
|
-
* @param url The URL returned from the Spotify app after calling authorizeAndPlayURI
|
|
192
|
-
*
|
|
193
|
-
* @return A dictionary containing the access token or error description from the provided URL.
|
|
194
|
-
* Will return nil if the URL Scheme does not match the redirect URI provided.
|
|
195
|
-
* Use `SPTAppRemoteAccessTokenKey` and `SPTAppRemoteErrorDescriptionKey` to get the appropriate values.
|
|
196
|
-
*/
|
|
197
|
-
- (nullable NSDictionary<NSString *, NSString *> *)authorizationParametersFromURL:(NSURL *)url;
|
|
198
|
-
|
|
199
|
-
#pragma mark APIs
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The API used to control the Spotify player.
|
|
203
|
-
*
|
|
204
|
-
* @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
|
|
205
|
-
* disconnect.
|
|
206
|
-
*/
|
|
207
|
-
@property (nullable, nonatomic, strong, readonly) id<SPTAppRemotePlayerAPI> playerAPI;
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* The API used to fetch images from the Spotify app.
|
|
211
|
-
*
|
|
212
|
-
* @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
|
|
213
|
-
* disconnect.
|
|
214
|
-
*/
|
|
215
|
-
@property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteImageAPI> imageAPI;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* The API used to fetch user data from the Spotify app.
|
|
219
|
-
*
|
|
220
|
-
* @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
|
|
221
|
-
* disconnect.
|
|
222
|
-
*/
|
|
223
|
-
@property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteUserAPI> userAPI;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* The API used to fetch content from the Spotify app.
|
|
227
|
-
*
|
|
228
|
-
* @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
|
|
229
|
-
* disconnect.
|
|
230
|
-
*/
|
|
231
|
-
@property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteContentAPI> contentAPI;
|
|
232
|
-
|
|
233
|
-
#pragma mark Unavailable initializers
|
|
234
|
-
|
|
235
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
236
|
-
+ (instancetype)new NS_UNAVAILABLE;
|
|
237
|
-
|
|
238
|
-
@end
|
|
239
|
-
|
|
240
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The `SPTAppRemoteAlbum` represents an Album entity.
|
|
7
|
-
*/
|
|
8
|
-
@protocol SPTAppRemoteAlbum <NSObject>
|
|
9
|
-
|
|
10
|
-
/// The name of the album.
|
|
11
|
-
@property (nonatomic, copy, readonly) NSString *name;
|
|
12
|
-
|
|
13
|
-
/// The URI of the album.
|
|
14
|
-
@property (nonatomic, copy, readonly) NSString *URI;
|
|
15
|
-
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The `SPTAppRemoteArtist` represents an artist.
|
|
7
|
-
*/
|
|
8
|
-
@protocol SPTAppRemoteArtist <NSObject>
|
|
9
|
-
|
|
10
|
-
/// The name of the artist.
|
|
11
|
-
@property (nonatomic, copy, readonly) NSString *name;
|
|
12
|
-
|
|
13
|
-
/// The URI of the artist.
|
|
14
|
-
@property (nonatomic, copy, readonly) NSString *URI;
|
|
15
|
-
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Common header definitions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
6
|
-
|
|
7
|
-
/// The error domain for user facing errors that occur in the App Remote.
|
|
8
|
-
extern NSString * const SPTAppRemoteErrorDomain;
|
|
9
|
-
|
|
10
|
-
/// The error codes in the `SPTAppRemoteErrorDomain` domain.
|
|
11
|
-
typedef NS_ENUM(NSInteger, SPTAppRemoteErrorCode) {
|
|
12
|
-
/// An unknown error.
|
|
13
|
-
SPTAppRemoteUnknownError = -1,
|
|
14
|
-
|
|
15
|
-
/// The background wakeup of the Spotify app failed.
|
|
16
|
-
SPTAppRemoteBackgroundWakeupFailedError = -1000,
|
|
17
|
-
/// The connection attempt to the Spotify app failed.
|
|
18
|
-
SPTAppRemoteConnectionAttemptFailedError = -1001,
|
|
19
|
-
/// The conncetion to the Spotify app was terminated.
|
|
20
|
-
SPTAppRemoteConnectionTerminatedError = -1002,
|
|
21
|
-
/// The arguments supplied are invalid.
|
|
22
|
-
SPTAppRemoteInvalidArgumentsError = -2000,
|
|
23
|
-
/// The request has failed for some reason.
|
|
24
|
-
SPTAppRemoteRequestFailedError = -2001,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A callback block used by many App Remote API methods.
|
|
29
|
-
*
|
|
30
|
-
* @param result The result of the operation, or `nil` if the operation failed.
|
|
31
|
-
* @param error An error object, or `nil` if the operation was a success.
|
|
32
|
-
*/
|
|
33
|
-
typedef void (^SPTAppRemoteCallback)(id _Nullable result, NSError * _Nullable error);
|
|
34
|
-
|
|
35
|
-
NS_ASSUME_NONNULL_END
|
|
36
|
-
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
/// Available image formats to receive from the Spotify app.
|
|
4
|
-
typedef NS_ENUM(NSUInteger, SPTAppRemoteConnectionParamsImageFormat) {
|
|
5
|
-
/// Any image format is acceptable. Use this if you don't care about which image format is sent.
|
|
6
|
-
SPTAppRemoteConnectionParamsImageFormatAny = 0,
|
|
7
|
-
/// JPEG image format.
|
|
8
|
-
SPTAppRemoteConnectionParamsImageFormatJPEG,
|
|
9
|
-
/// PNG image format.
|
|
10
|
-
SPTAppRemoteConnectionParamsImageFormatPNG,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
struct CGSize;
|
|
14
|
-
|
|
15
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The `SPTAppRemoteconnectionParams` represents connection parameters required in order to initiate a connection
|
|
19
|
-
* with the Spotify app.
|
|
20
|
-
*/
|
|
21
|
-
@interface SPTAppRemoteConnectionParams : NSObject
|
|
22
|
-
|
|
23
|
-
/// The access token used to authorize the user with the Spotify app.
|
|
24
|
-
@property (nonatomic, copy, readwrite, nullable) NSString *accessToken;
|
|
25
|
-
|
|
26
|
-
/// The desired size of received images. (0,0) acts as a wildcard and accepts any size.
|
|
27
|
-
@property (nonatomic, assign, readonly) struct CGSize defaultImageSize;
|
|
28
|
-
|
|
29
|
-
/// The desired image format of received images.
|
|
30
|
-
@property (nonatomic, assign, readonly) SPTAppRemoteConnectionParamsImageFormat imageFormat;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Initialize a set of new connection parameters.
|
|
34
|
-
*
|
|
35
|
-
* @discussion This is the designated initializer.
|
|
36
|
-
*
|
|
37
|
-
* @param accessToken The access token obtained after authentication.
|
|
38
|
-
* @param defaultImageSize The desired size of received images. (0,0) acts as a wildcard and accepts any size.
|
|
39
|
-
* @param imageFormat The desired image format of received images.
|
|
40
|
-
*
|
|
41
|
-
* @return A set of connection parameters ready to be used when initiating a connection to the Spotify app.
|
|
42
|
-
*/
|
|
43
|
-
- (instancetype)initWithAccessToken:(nullable NSString *)accessToken
|
|
44
|
-
defaultImageSize:(struct CGSize)defaultImageSize
|
|
45
|
-
imageFormat:(SPTAppRemoteConnectionParamsImageFormat)imageFormat NS_DESIGNATED_INITIALIZER;
|
|
46
|
-
|
|
47
|
-
#pragma mark Static properties
|
|
48
|
-
|
|
49
|
-
/// Version of the protocol
|
|
50
|
-
@property (nonatomic, assign, readonly) NSInteger protocolVersion;
|
|
51
|
-
|
|
52
|
-
/// Roles
|
|
53
|
-
@property (nonatomic, copy, readonly) NSDictionary *roles;
|
|
54
|
-
|
|
55
|
-
/// Authentication methods supported
|
|
56
|
-
@property (nonatomic, copy, readonly) NSArray *authenticationMethods;
|
|
57
|
-
|
|
58
|
-
#pragma mark Unavailable initializers
|
|
59
|
-
|
|
60
|
-
- (instancetype)init NS_UNAVAILABLE;
|
|
61
|
-
+ (instancetype)new NS_UNAVAILABLE;
|
|
62
|
-
|
|
63
|
-
@end
|
|
64
|
-
|
|
65
|
-
NS_ASSUME_NONNULL_END
|