@wwdrew/expo-spotify-sdk 2.1.0 → 2.2.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.
Files changed (86) hide show
  1. package/README.md +32 -2
  2. package/android/build.gradle +4 -5
  3. package/android/libs/SETUP.md +9 -24
  4. package/android/spotify-native-sdk.gradle +118 -0
  5. package/android/src/main/java/expo/modules/spotifysdk/ExpoSpotifySDKModule.kt +12 -1
  6. package/android/src/main/java/expo/modules/spotifysdk/SpotifyAppRemoteCoordinator.kt +32 -0
  7. package/build/app-remote/index.d.ts +34 -0
  8. package/build/app-remote/index.d.ts.map +1 -1
  9. package/build/app-remote/index.js +36 -0
  10. package/build/app-remote/index.js.map +1 -1
  11. package/ios/ExpoSpotifyAppDelegate.swift +8 -1
  12. package/ios/ExpoSpotifySDK.podspec +26 -2
  13. package/ios/ExpoSpotifySDKModule.swift +16 -1
  14. package/ios/SpotifyAppRemoteCoordinator.swift +108 -0
  15. package/ios/spotify-native-sdk-versions.json +12 -0
  16. package/package.json +10 -4
  17. package/ios/SpotifySDK/Licenses/MPMessagePack-LICENSE.md +0 -20
  18. package/ios/SpotifySDK/SpotifyiOS.xcframework/Info.plist +0 -40
  19. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -287
  20. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
  21. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
  22. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -37
  23. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
  24. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h +0 -55
  25. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h +0 -15
  26. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -78
  27. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -49
  28. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
  29. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
  30. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
  31. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
  32. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
  33. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
  34. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -267
  35. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
  36. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
  37. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -52
  38. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -102
  39. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
  40. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -66
  41. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTError.h +0 -31
  42. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
  43. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTMacros.h +0 -125
  44. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTScope.h +0 -75
  45. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSession.h +0 -33
  46. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -170
  47. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -28
  48. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
  49. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist +0 -0
  50. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Modules/module.modulemap +0 -5
  51. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/PrivacyInfo.xcprivacy +0 -14
  52. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS +0 -0
  53. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -287
  54. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
  55. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
  56. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -37
  57. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
  58. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h +0 -55
  59. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h +0 -15
  60. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -78
  61. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -49
  62. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
  63. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
  64. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
  65. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
  66. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
  67. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
  68. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -267
  69. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
  70. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
  71. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -52
  72. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -102
  73. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
  74. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -66
  75. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +0 -31
  76. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
  77. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTMacros.h +0 -125
  78. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +0 -75
  79. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSession.h +0 -33
  80. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -170
  81. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -28
  82. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
  83. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
  84. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +0 -5
  85. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/PrivacyInfo.xcprivacy +0 -14
  86. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
@@ -1,170 +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
- /// Authorize using a suitable method. If Spotify is installed the app will be used instead of ASWebAuthentication.
12
- SPTDefaultAuthorizationOption NS_SWIFT_NAME(default) = (0),
13
- /// Authorize using only the Spotify client. If Spotify is not installed authorization will fail.
14
- SPTClientAuthorizationOption NS_SWIFT_NAME(clientOnly) = (1 << 0),
15
- /// Use this option if you have reached the limit of `LSApplicationQueriesSchemes` in your Info.plist
16
- /// Attempt to open Spotify app directly without using `canOpenURL`. Falls back to ASWebAuthentication if
17
- /// opening fails.
18
- SPTSpotifySchemeNotRegisteredAuthorizationOption NS_SWIFT_NAME(spotifySchemeNotRegistered) = (1 << 1),
19
- } NS_SWIFT_NAME(AuthorizationOptions);
20
-
21
- typedef NSString *const SPTAuthorizationCode;
22
-
23
-
24
- /// This class manages a Spotify user session, in the form of `SPTSession`.
25
- @interface SPTSessionManager : NSObject
26
-
27
- /// The `SPTSession` for the `SPTSessionManager` to manage. If no user has been authenticated this will be nil
28
- @property (nullable, nonatomic, strong) SPTSession *session;
29
-
30
- /// The `SPTSessionManagerDelegate` to notify of initiating a session, renewing a session, and/or errors related to a
31
- /// session
32
- @property (nullable, nonatomic, weak) id<SPTSessionManagerDelegate> delegate;
33
-
34
- /**
35
- Determine if the Spotify app is installed.
36
-
37
- Will be `YES` if the Spotify app is installed (and the URL scheme is whitelisted), otherwise is `NO`.
38
- Note: You must whitelist the "spotify" URL scheme in your info.plist LSApplicationQueriesSchemes or this will always be
39
- NO
40
- */
41
- @property (nonatomic, readonly, getter=isSpotifyAppInstalled) BOOL spotifyAppInstalled;
42
-
43
- /**
44
- Set this value to `YES` when debugging to have the Spotify app always show the authorization confirmation screen.
45
- You SHOULD NOT set this value to `YES` in production or your users will always have to confirm.
46
- */
47
- @property (nonatomic, assign) BOOL alwaysShowAuthorizationDialog;
48
-
49
- - (instancetype)init NS_UNAVAILABLE;
50
-
51
- /**
52
- Initiate the authorization process
53
-
54
- @param scope The scope to request, e.g. `SPTPlaylistReadPrivateScope`|`SPTUserReadEmailScope` if you wish to request
55
- read access to private playlists, and read access to the user's email address.
56
- @param options Options bitmask that informs authorization behavior.
57
- @param campaign The campaign identifier, to help attribute where the account linking was initiated from.
58
- See `SPTSessionManagerDelegate` for messages regarding changes in session state.
59
- */
60
- - (void)initiateSessionWithScope:(SPTScope)scope
61
- options:(SPTAuthorizationOptions)options
62
- campaign:(nullable NSString *)campaign;
63
-
64
- /**
65
- Initiate the authorization process
66
- @note Prefer `initiateSessionWithScope:options:campaign` instead, unless you need additional scopes that aren't listed
67
- in `SPTScope`
68
- @param scope The scope to request, e.g. `"playlist-read-private user-read-email"` if you wish to request read access to
69
- private playlists, and read access to the user's email address.
70
- @param options Options bitmask that informs authorization behavior.
71
- @param campaign The campaign identifier, to help attribute where the account linking was initiated from.
72
- See `SPTSessionManagerDelegate` for messages regarding changes in session state.
73
- */
74
- - (void)initiateSessionWithRawScope:(NSString *)scope
75
- options:(SPTAuthorizationOptions)options
76
- campaign:(nullable NSString *)campaign;
77
-
78
- /// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid.
79
- - (void)renewSession;
80
-
81
- /**
82
- Create an `SPTSessionManager` with the provided configuration.
83
-
84
- @param configuration An `SPTConfiguration` object.
85
- @param delegate An optional delegate conforming to `SPTSessionManagerDelegate`.
86
- @return An `SPTSessionManager` with the desired configuration.
87
- */
88
- - (instancetype)initWithConfiguration:(SPTConfiguration *)configuration
89
- delegate:(nullable id<SPTSessionManagerDelegate>)delegate;
90
-
91
- + (instancetype)sessionManagerWithConfiguration:(SPTConfiguration *)configuration
92
- delegate:(nullable id<SPTSessionManagerDelegate>)delegate;
93
- /**
94
- Handle openURL callbacks from the `AppDelegate`
95
-
96
- @param application The `UIApplication` passed into the matching `AppDelegate` method
97
- @param URL The URL to attempt to parse the access token from
98
- @param options The options passed in to the matching `AppDelegate` method
99
- @return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise
100
- returns `NO`.
101
- */
102
- - (BOOL)application:(UIApplication *)application
103
- openURL:(NSURL *)URL
104
- options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options;
105
-
106
- /**
107
- Handle continueUserActivity callbacks from the `AppDelegate`
108
-
109
- @param application The `UIApplication` passed into the matching `AppDelegate` method
110
- @param userActivity An object encapsulating a user activity supported by this responder.
111
- @param restorationHandler A block to execute if your app creates objects to perform the task the user was performing
112
- @return Returns `YES` if `SPTSessionManager` recognizes the URL and will attempt to parse an access token, otherwise
113
- returns `NO`.
114
- */
115
- - (BOOL)application:(UIApplication *)application
116
- continueUserActivity:(NSUserActivity *)userActivity
117
- restorationHandler:
118
- (void (^)(NSArray<id<UIUserActivityRestoring>> *__nullable restorableObjects))restorationHandler;
119
-
120
- @end
121
-
122
- /// The `SPTSessionManagerDelegate` to use for monitoring state changes of a `SPTSessionManager`
123
- @protocol SPTSessionManagerDelegate <NSObject>
124
-
125
- /**
126
- This message is sent when a session has been initiated successfully.
127
-
128
- @param manager The `SPTSessionManager` that initiated the session.
129
- @param session The initiated `SPTSession` object.
130
- */
131
- - (void)sessionManager:(SPTSessionManager *)manager
132
- didInitiateSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didInitiate:));
133
-
134
- /**
135
- This message is sent when the manager failed to initiate or renew a session.
136
-
137
- @param manager The `SPTSessionManager` instance.
138
- @param error The `NSError` that occured.
139
- */
140
- - (void)sessionManager:(SPTSessionManager *)manager
141
- didFailWithError:(NSError *)error NS_SWIFT_NAME(sessionManager(manager:didFailWith:));
142
-
143
- @optional
144
-
145
- /**
146
- This message is sent when the manager has renewed a session.
147
-
148
- @param manager The `SPTSessionManager` instance.
149
- @param session The renewed `SPTSession` object.
150
- */
151
- - (void)sessionManager:(SPTSessionManager *)manager
152
- didRenewSession:(SPTSession *)session NS_SWIFT_NAME(sessionManager(manager:didRenew:));
153
-
154
- /**
155
- Sent when the `SPTSessionManager` has obtained an authorization code,
156
- and is about to swap it for an access token. If you wish to handle this
157
- yourself, return `NO` and use the provided authorization code.
158
-
159
- @param manager The `SPTSessionManager` instance.
160
- @param code An OAuth authorization code.
161
- @return `NO` to request the access token yourself; `YES` to let `SPTSessionManager` handle it.
162
- */
163
- - (BOOL)sessionManager:(SPTSessionManager *)manager
164
- shouldRequestAccessTokenWithAuthorizationCode:(SPTAuthorizationCode)code
165
- NS_SWIFT_NAME(sessionManager(manager:shouldRequestAccessTokenWith:));
166
-
167
- @end
168
-
169
-
170
- NS_ASSUME_NONNULL_END
@@ -1,28 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #ifndef _SPOTIFYAPPREMOTE_
4
- #define _SPOTIFYAPPREMOTE_
5
-
6
- #import "SPTAppRemote.h"
7
- #import "SPTAppRemoteAlbum.h"
8
- #import "SPTAppRemoteArtist.h"
9
- #import "SPTAppRemoteCommon.h"
10
- #import "SPTAppRemoteConnectionParams.h"
11
- #import "SPTAppRemoteConnectivityAPI.h"
12
- #import "SPTAppRemoteConnectivityState.h"
13
- #import "SPTAppRemoteContentAPI.h"
14
- #import "SPTAppRemoteContentItem.h"
15
- #import "SPTAppRemoteCrossfadeState.h"
16
- #import "SPTAppRemoteImageAPI.h"
17
- #import "SPTAppRemoteLibraryState.h"
18
- #import "SPTAppRemotePlaybackOptions.h"
19
- #import "SPTAppRemotePlaybackRestrictions.h"
20
- #import "SPTAppRemotePlayerAPI.h"
21
- #import "SPTAppRemotePlayerState.h"
22
- #import "SPTAppRemotePodcastPlaybackSpeed.h"
23
- #import "SPTAppRemoteTrack.h"
24
- #import "SPTAppRemoteUserAPI.h"
25
- #import "SPTAppRemoteUserCapabilities.h"
26
- #import "SPTConfiguration.h"
27
-
28
- #endif /* _SPOTIFYAPPREMOTE_ */
@@ -1,7 +0,0 @@
1
- #ifndef _SPOTIFYIOS_
2
- #define _SPOTIFYIOS_
3
-
4
- #import "SPTLogin.h"
5
- #import "SpotifyAppRemote.h"
6
-
7
- #endif /* _SPOTIFYIOS_ */
@@ -1,5 +0,0 @@
1
- framework module SpotifyiOS {
2
- umbrella header "SpotifyiOS.h"
3
- export *
4
- module * { export * }
5
- }
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>NSPrivacyCollectedDataTypes</key>
6
- <array/>
7
- <key>NSPrivacyAccessedAPITypes</key>
8
- <array/>
9
- <key>NSPrivacyTrackingDomains</key>
10
- <array/>
11
- <key>NSPrivacyTracking</key>
12
- <false/>
13
- </dict>
14
- </plist>
@@ -1,287 +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
- @protocol SPTAppRemoteConnectivityAPI;
12
-
13
- NS_ASSUME_NONNULL_BEGIN
14
-
15
- extern NSString *const SPTAppRemoteAccessTokenKey;
16
- extern NSString *const SPTAppRemoteErrorKey;
17
- extern NSString *const SPTAppRemoteErrorDescriptionKey;
18
-
19
- /// The severity of log messages that the App Remote should log to console.
20
- typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
21
- /// Do not log at all.
22
- SPTAppRemoteLogLevelNone = 0,
23
- /// Log debug, info and error messages.
24
- SPTAppRemoteLogLevelDebug = 1,
25
- /// Log info and error messages.
26
- SPTAppRemoteLogLevelInfo = 2,
27
- /// Log only error messages.
28
- SPTAppRemoteLogLevelError = 3,
29
- };
30
-
31
- /**
32
- * The `SPTAppRemoteDelegate` receives updates from the `SPTAppRemote` whenever something has
33
- * happened with the connection.
34
- */
35
- @protocol SPTAppRemoteDelegate <NSObject>
36
-
37
- /**
38
- * Called when the App Remote has established connection with the Spotify app.
39
- *
40
- * @param appRemote The transport that has connected.
41
- */
42
- - (void)appRemoteDidEstablishConnection:(SPTAppRemote *)appRemote;
43
-
44
- /**
45
- * Called when the connection attempt made by the App Remote failed.
46
- *
47
- * @param appRemote The App Remote that failed to connect.
48
- * @param error The error that occurred.
49
- */
50
- - (void)appRemote:(SPTAppRemote *)appRemote didFailConnectionAttemptWithError:(nullable NSError *)error;
51
-
52
- /**
53
- * Called when the App Remote has disconnected.
54
- *
55
- * @note All APIs will be released by the App Remote at this point. The will no longer be usable,
56
- * and so you should release them as well.
57
- *
58
- * @param appRemote The App Remote that disconnected.
59
- * @param error The error that caused the disconnect, or `nil` if the disconnect was explicit.
60
- */
61
- - (void)appRemote:(SPTAppRemote *)appRemote didDisconnectWithError:(nullable NSError *)error;
62
-
63
- @end
64
-
65
- /**
66
- * The `SPTAppRemote` is the main entry point for interacting with the Spotify app using the Spotify App Remote for
67
- * iOS.
68
- */
69
- @interface SPTAppRemote : NSObject
70
-
71
- #pragma mark Lifecycle
72
-
73
- /**
74
- * Convenience Initializer for a new App Remote instance
75
- *
76
- * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs
77
- * @param logLevel The lowest severity to log to console.
78
- *
79
- * @return A fresh new App Remote, ready to connect.
80
- */
81
- - (instancetype)initWithConfiguration:(SPTConfiguration *)configuration logLevel:(SPTAppRemoteLogLevel)logLevel;
82
-
83
- /**
84
- * Designated Initializer for a new App Remote instance
85
- *
86
- * @param configuration The `SPTConfiguration` to use for client-id's and redirect URLs
87
- * @param connectionParameters `SPTAppRemoteConnectionParams` for custom image sizes and types, and to hold the
88
- * accessToken
89
- * @param logLevel The lowest severity to log to console.
90
- *
91
- * @return A fresh new App Remote, ready to connect.
92
- */
93
- - (instancetype)initWithConfiguration:(SPTConfiguration *)configuration
94
- connectionParameters:(SPTAppRemoteConnectionParams *)connectionParameters
95
- logLevel:(SPTAppRemoteLogLevel)logLevel NS_DESIGNATED_INITIALIZER;
96
- #pragma mark Class Methods
97
-
98
- /**
99
- * Determine the current version of the Spotify App Remote
100
- *
101
- * @return The current version of the Spotify App Remote
102
- */
103
- + (NSString *)appRemoteVersion;
104
-
105
- /**
106
- * The Spotify app iTunes item identifier for use with `SKStoreProductViewController` for installing Spotify from the
107
- * App Store.
108
- *
109
- * @return An `NSNumber` representing the Spotify iTunes item identifier to be used for the
110
- * `SKStoreProductParameterITunesItemIdentifier` key
111
- */
112
- + (NSNumber *)spotifyItunesItemIdentifier;
113
-
114
- #pragma mark Connection
115
-
116
- /**
117
- * The parameters to use during connection.
118
- */
119
- @property (nonatomic, strong, readonly) SPTAppRemoteConnectionParams *connectionParameters;
120
-
121
- /**
122
- * `YES` if the App Remote is connected to the Spotify application, otherwise `NO`.
123
- *
124
- * @note Not KVO’able.
125
- *
126
- * See The `SPTAppRemoteDelegate` in order to receive updates when the connection status changes.
127
- */
128
- @property (nonatomic, assign, readonly, getter=isConnected) BOOL connected;
129
-
130
- /**
131
- * The delegate to notify for connection status changes and other events originating from the App Remote.
132
- */
133
- @property (nonatomic, weak) id<SPTAppRemoteDelegate> delegate;
134
-
135
- /**
136
- * Attempts to connect to the Spotify application.
137
- *
138
- * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up
139
- */
140
- - (void)connect;
141
-
142
- /**
143
- * Attempts to connect to the Spotify application with a given session identifier.
144
- *
145
- * @discussion If the Spotify app is not running you will need to use authorizeAndPlayURI: to wake it up.
146
- *
147
- * @discussion If `authorizeAndPlayURI` was used without a given session identifier, `connect` should be used instead of
148
- * this method.
149
- *
150
- * @param sessionIdentifier The unique session identifier which was used when calling
151
- * `authorizeAndPlayURI:asRadio:additionalScopes:sessionIdentifier:`
152
- */
153
- - (void)connectWithSessionIdentifier:(NSUUID *)sessionIdentifier;
154
-
155
- /**
156
- * Disconnect from the Spotify application
157
- */
158
- - (void)disconnect;
159
-
160
- /**
161
- * Open Spotify app to obtain access token and start playback.
162
- * The passed URI will start playing unless Spotify is already playing.
163
- *
164
- * @param URI The URI to play. Use a blank string to attempt to play the user's last song
165
- * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise
166
- * `NO`.
167
- *
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
- - (void)authorizeAndPlayURI:(NSString *)URI completionHandler:(void (^__nullable)(BOOL success))completionHandler;
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 completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise
179
- * `NO`.
180
- *
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
- - (void)authorizeAndPlayURI:(NSString *)playURI
185
- asRadio:(BOOL)asRadio
186
- completionHandler:(void (^__nullable)(BOOL success))completionHandler;
187
-
188
- /**
189
- * Open Spotify app to obtain access token and start playback.
190
- *
191
- * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
192
- * @param asRadio `YES` to start radio for the given URI.
193
- * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need
194
- * `app-remote-control`
195
- * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise
196
- * `NO`.
197
- *
198
- * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
199
- * the Spotify app is installed and can attempt to handle the authorization request.
200
- */
201
- - (void)authorizeAndPlayURI:(NSString *)playURI
202
- asRadio:(BOOL)asRadio
203
- additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
204
- completionHandler:(void (^__nullable)(BOOL success))completionHandler;
205
-
206
- /**
207
- * Open Spotify app to obtain access token and start playback.
208
- *
209
- * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
210
- * @param asRadio `YES` to start radio for the given URI.
211
- * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need
212
- * `app-remote-control`
213
- * @param sessionIdentifier An optional unique identifier for this specific session, which is used for analytics
214
- * purposes. Every new attempt to connect to the Spotify app should have a new identifier, but the identifier used here
215
- * should then be reused for the accompanied call to `connectWithSessionIdentifier:`.
216
- * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise
217
- * `NO`.
218
- *
219
- * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
220
- * the Spotify app is installed and can attempt to handle the authorization request.
221
- */
222
- - (void)authorizeAndPlayURI:(NSString *)playURI
223
- asRadio:(BOOL)asRadio
224
- additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
225
- sessionIdentifier:(nullable NSUUID *)sessionIdentifier
226
- completionHandler:(void (^__nullable)(BOOL success))completionHandler;
227
- /**
228
- * Parse out an access token or error description from a url passed to application:openURL:options:
229
- *
230
- * @param url The URL returned from the Spotify app after calling authorizeAndPlayURI
231
- *
232
- * @return A dictionary containing the access token or error description from the provided URL.
233
- * Will return nil if the URL Scheme does not match the redirect URI provided.
234
- * Use `SPTAppRemoteAccessTokenKey` and `SPTAppRemoteErrorDescriptionKey` to get the appropriate values.
235
- */
236
- - (nullable NSDictionary<NSString *, NSString *> *)authorizationParametersFromURL:(NSURL *)url;
237
-
238
- #pragma mark APIs
239
-
240
- /**
241
- * The API used to control the Spotify player.
242
- *
243
- * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
244
- * disconnect.
245
- */
246
- @property (nullable, nonatomic, strong, readonly) id<SPTAppRemotePlayerAPI> playerAPI;
247
-
248
- /**
249
- * The API used to fetch images from the Spotify app.
250
- *
251
- * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
252
- * disconnect.
253
- */
254
- @property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteImageAPI> imageAPI;
255
-
256
- /**
257
- * The API used to fetch user data from the Spotify app.
258
- *
259
- * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
260
- * disconnect.
261
- */
262
- @property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteUserAPI> userAPI;
263
-
264
- /**
265
- * The API used to fetch content from the Spotify app.
266
- *
267
- * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
268
- * disconnect.
269
- */
270
- @property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteContentAPI> contentAPI;
271
-
272
- /**
273
- * The API used to get connectivity data from the Spotify app.
274
- *
275
- * @note Will only be populated when the App Remote is connected. If you retain this object you must release it on
276
- * disconnect.
277
- */
278
- @property (nullable, nonatomic, strong, readonly) id<SPTAppRemoteConnectivityAPI> connectivityAPI;
279
-
280
- #pragma mark Unavailable initializers
281
-
282
- - (instancetype)init NS_UNAVAILABLE;
283
- + (instancetype)new NS_UNAVAILABLE;
284
-
285
- @end
286
-
287
- 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,37 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- /**
4
- * Common header definitions
5
- */
6
-
7
- NS_ASSUME_NONNULL_BEGIN
8
-
9
- /// The error domain for user facing errors that occur in the App Remote.
10
- extern NSString *const SPTAppRemoteErrorDomain;
11
-
12
- /// The error codes in the `SPTAppRemoteErrorDomain` domain.
13
- typedef NS_ENUM(NSInteger, SPTAppRemoteErrorCode) {
14
- /// An unknown error.
15
- SPTAppRemoteUnknownError = -1,
16
-
17
- /// The background wakeup of the Spotify app failed.
18
- SPTAppRemoteBackgroundWakeupFailedError = -1000,
19
- /// The connection attempt to the Spotify app failed.
20
- SPTAppRemoteConnectionAttemptFailedError = -1001,
21
- /// The conncetion to the Spotify app was terminated.
22
- SPTAppRemoteConnectionTerminatedError = -1002,
23
- /// The arguments supplied are invalid.
24
- SPTAppRemoteInvalidArgumentsError = -2000,
25
- /// The request has failed for some reason.
26
- SPTAppRemoteRequestFailedError = -2001,
27
- };
28
-
29
- /**
30
- * A callback block used by many App Remote API methods.
31
- *
32
- * @param result The result of the operation, or `nil` if the operation failed.
33
- * @param error An error object, or `nil` if the operation was a success.
34
- */
35
- typedef void (^SPTAppRemoteCallback)(id _Nullable result, NSError *_Nullable error);
36
-
37
- NS_ASSUME_NONNULL_END
@@ -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