@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,55 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "SPTAppRemoteCommon.h"
3
-
4
- @protocol SPTAppRemoteConnectivityAPI;
5
- @protocol SPTAppRemoteConnectivityState;
6
-
7
- NS_ASSUME_NONNULL_BEGIN
8
-
9
- /**
10
- * The `SPTAppRemoteConnectivityAPIDelegate` gets notified whenever the connectivity API receives new data from
11
- * subscription events.
12
- */
13
- @protocol SPTAppRemoteConnectivityAPIDelegate <NSObject>
14
-
15
- /**
16
- * Called when the connectivity state has been updated.
17
- *
18
- * @param connectivityAPI The API that received updates.
19
- * @param connectivityState The new connectivity state received.
20
- */
21
- - (void)connectivityAPI:(id<SPTAppRemoteConnectivityAPI>)connectivityAPI
22
- didReceiveNewConnectivityState:(id<SPTAppRemoteConnectivityState>)connectivityState;
23
-
24
- @end
25
-
26
- /**
27
- The @c SPTAppRemoteConnectivityAPI class is used to get connectivity data from the Spotify app.
28
- */
29
- @protocol SPTAppRemoteConnectivityAPI <NSObject>
30
-
31
- /// The delegate receiving player state updates
32
- @property (nonatomic, weak) id<SPTAppRemoteConnectivityAPIDelegate> delegate;
33
-
34
- /**
35
- * Subscribes to connection state changes from the Spotify app.
36
- *
37
- * @note Implement `SPTAppRemoteConnectivityAPIDelegate` and set yourself as delegate in order to be notified when the
38
- * the connection state changes.
39
- *
40
- * @param callback On success `result` will be `YES`
41
- * On error `result` will be `nil` and error set
42
- */
43
- - (void)subscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback;
44
-
45
- /**
46
- * Stops subscribing to connection state changes from the Spotify app.
47
- *
48
- * @param callback On success `result` will be `YES`
49
- * On error `result` will be `nil` and error set
50
- */
51
- - (void)unsubscribeToConnectivityState:(nullable SPTAppRemoteCallback)callback;
52
-
53
- @end
54
-
55
- NS_ASSUME_NONNULL_END
@@ -1,15 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- The @c SPTAppRemoteConnectivityState class represents the online/offline state of the Spotify app.
7
- */
8
- @protocol SPTAppRemoteConnectivityState <NSObject>
9
-
10
- /// Whether the Spotify app is offline or not.
11
- @property (nonatomic, readonly, getter=isOffline) BOOL offline;
12
-
13
- @end
14
-
15
- NS_ASSUME_NONNULL_END
@@ -1,78 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "SPTAppRemoteCommon.h"
3
-
4
- NS_ASSUME_NONNULL_BEGIN
5
-
6
- /// A type representing different lists of content.
7
- typedef NSString *const SPTAppRemoteContentType;
8
-
9
- extern NSString *const SPTAppRemoteContentTypeDefault;
10
- extern NSString *const SPTAppRemoteContentTypeNavigation;
11
- extern NSString *const SPTAppRemoteContentTypeFitness;
12
- extern NSString *const SPTAppRemoteContentTypeGaming;
13
-
14
- @protocol SPTAppRemoteContentItem;
15
-
16
- /**
17
- * The `SPTAppRemoteContentAPI` is used to access content from the Spotify application.
18
- */
19
- @protocol SPTAppRemoteContentAPI <NSObject>
20
-
21
- /**
22
- * Fetches the root level of content items for the current user.
23
- *
24
- * @note The content returned is based on the users' home feeds, and as such may vary
25
- * between different users. If the user has no network connection or Spotify is
26
- * forced offline, this method will return the user's offline content, if any.
27
- *
28
- * Deprecated. Use fetchRecommendedContentItemsForType:flattenContainers:callback: instead.
29
- *
30
- * @param contentType A type that is used to retrieve content for a specific use-case.
31
- * @param callback The callback to be called once the request is completed.
32
- */
33
- - (void)fetchRootContentItemsForType:(SPTAppRemoteContentType)contentType
34
- callback:(nullable SPTAppRemoteCallback)callback
35
- DEPRECATED_MSG_ATTRIBUTE(
36
- "Deprecated. Use fetchRecommendedContentItemsForType:flattenContainers:callback: instead.");
37
-
38
- /**
39
- * Fetches the children items for the provided content item.
40
- *
41
- * @note The `isContainer` property of the `SPTAppRemoteContentItem`
42
- * indicates whether or not the item has any children.
43
- *
44
- * @param contentItem The content item to fetch the children for.
45
- * @param callback The callback to be called once the request is completed.
46
- */
47
- - (void)fetchChildrenOfContentItem:(id<SPTAppRemoteContentItem>)contentItem
48
- callback:(nullable SPTAppRemoteCallback)callback;
49
-
50
- /**
51
- * Fetches a list of recommended playlists for the current user.
52
- *
53
- * @note The playlists returned are a mix of the user's recently played feed
54
- * as well as personal recommendations, and as such may vary between users. If the
55
- * user is offline, this method will only return the content that is available offline, if any.
56
- * @note This method is only supported by Spotify clients running version 8.4.75 and above
57
- * and will fail with an `SPTAppRemoteWAMPClientNotSupportedError` otherwise.
58
- *
59
- * @param contentType A type that is used to retrieve content for a specific use-case.
60
- * @param flattenContainers Whether or not the recommendations should be flattened into a single list or remain
61
- * separated in containers.
62
- * @param callback The callback to be called once the request is completed.
63
- */
64
- - (void)fetchRecommendedContentItemsForType:(SPTAppRemoteContentType)contentType
65
- flattenContainers:(BOOL)flattenContainers
66
- callback:(nullable SPTAppRemoteCallback)callback;
67
-
68
- /**
69
- Fetches the content item for the provided URI.
70
-
71
- @param URI A Spotify URI as string
72
- @param callback The callback to be called once the request is completed.
73
- */
74
- - (void)fetchContentItemForURI:(NSString *)URI callback:(nullable SPTAppRemoteCallback)callback;
75
-
76
- @end
77
-
78
- NS_ASSUME_NONNULL_END
@@ -1,49 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "SPTAppRemoteImageRepresentable.h"
3
-
4
- NS_ASSUME_NONNULL_BEGIN
5
-
6
- /**
7
- * The `SPTAppRemoteContentItem` protocol represents a track or a collection of tracks. Use the `isContainer` instance
8
- * method to determine if the content item is a collection of tracks for which to grab children from.
9
- */
10
- @protocol SPTAppRemoteContentItem <NSObject, SPTAppRemoteImageRepresentable>
11
-
12
- /// The primary title of the item.
13
- @property (nonatomic, copy, readonly, nullable) NSString *title;
14
-
15
- /// The secondary title of the item.
16
- @property (nonatomic, copy, readonly, nullable) NSString *subtitle;
17
-
18
- /// The description of the item.
19
- @property (nonatomic, copy, readonly, nullable) NSString *contentDescription;
20
-
21
- /// The unique identifier of the item.
22
- @property (nonatomic, copy, readonly) NSString *identifier;
23
-
24
- /// The playback URI of this item.
25
- @property (nonatomic, copy, readonly) NSString *URI;
26
-
27
- /// `YES` if the item is available offline, or if it has any child that is available offline, otherwise `NO`.
28
- @property (nonatomic, assign, readonly, getter=isAvailableOffline) BOOL availableOffline;
29
-
30
- /// Returns `YES` if the item is directly playable, otherwise `NO`.
31
- @property (nonatomic, assign, readonly, getter=isPlayable) BOOL playable;
32
-
33
- /// Returns `YES` if the item is expected to contain children, otherwise `NO`.
34
- @property (nonatomic, assign, readonly, getter=isContainer) BOOL container;
35
-
36
- /// Returns `YES` if the item is pinned in Your Library, otherwise `NO`.
37
- @property (nonatomic, assign, readonly, getter=isPinned) BOOL pinnned;
38
-
39
- /**
40
- A list of the content item's children.
41
-
42
- @note This is not populated for all container items as some of them are fetched
43
- lazily with the `fetchChildrenOfContentItem:callback:` method.
44
- */
45
- @property (nonatomic, strong, readonly, nullable) NSArray<id<SPTAppRemoteContentItem>> *children;
46
-
47
- @end
48
-
49
- NS_ASSUME_NONNULL_END
@@ -1,18 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- * The `SPTAppRemoteCrossfadeState` represents the state of crossfade.
7
- */
8
- @protocol SPTAppRemoteCrossfadeState <NSObject>
9
-
10
- /// The on/off state of crossfade.
11
- @property (nonatomic, readonly, getter=isEnabled) BOOL enabled;
12
-
13
- /// The duration of crossfade in milliseconds. The value is meaningless if crossfade is not enabled.
14
- @property (nonatomic, readonly) NSInteger duration;
15
-
16
- @end
17
-
18
- NS_ASSUME_NONNULL_END
@@ -1,25 +0,0 @@
1
- #import "SPTAppRemoteCommon.h"
2
- #import "SPTAppRemoteImageRepresentable.h"
3
-
4
- NS_ASSUME_NONNULL_BEGIN
5
-
6
- /**
7
- * API for fetching image data from the Spotify app
8
- */
9
- @protocol SPTAppRemoteImageAPI <NSObject>
10
-
11
- /**
12
- * Fetch an image with the given ID from the Spotify app.
13
- *
14
- * @param imageRepresentable The item containing the ID of the image to fetch.
15
- * @param imageSize The size of the image to fetch.
16
- * @param callback On success `result` will be an instance of `UIImage`
17
- * On error `result` will be nil and error set
18
- */
19
- - (void)fetchImageForItem:(id<SPTAppRemoteImageRepresentable>)imageRepresentable
20
- withSize:(CGSize)imageSize
21
- callback:(nullable SPTAppRemoteCallback)callback;
22
-
23
- @end
24
-
25
- NS_ASSUME_NONNULL_END
@@ -1,16 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- * The `SPTImageRepresentable` protocol represents an object that may contain an image.
7
- * If something conforms to this protocol you can pass it to `SPTAppRemoteImageAPI` fetchImageForItem: method.
8
- */
9
- @protocol SPTAppRemoteImageRepresentable <NSObject>
10
-
11
- /// The identifier of the image of the entity.
12
- @property (nonatomic, strong, readonly) NSString *imageIdentifier;
13
-
14
- @end
15
-
16
- NS_ASSUME_NONNULL_END
@@ -1,19 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- * The `SPTAppRemoteLibraryState` represents a the state of an album or track in a users Spotify library.
7
- */
8
- @protocol SPTAppRemoteLibraryState <NSObject>
9
-
10
- /// The uri of the track or album
11
- @property (nonatomic, strong, readonly) NSString *uri;
12
- /// `YES` album or track was added to the user's library, otherwise `NO`.
13
- @property (nonatomic, assign, readonly) BOOL isAdded;
14
- /// `YES` album or track can be added to the user's library, otherwise `NO`.
15
- @property (nonatomic, assign, readonly) BOOL canAdd;
16
-
17
- @end
18
-
19
- NS_ASSUME_NONNULL_END
@@ -1,32 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /// The available repeat modes.
6
- typedef NS_ENUM(NSUInteger, SPTAppRemotePlaybackOptionsRepeatMode) {
7
- /// Repeat is off.
8
- SPTAppRemotePlaybackOptionsRepeatModeOff = 0,
9
-
10
- /// Repeats the current track.
11
- SPTAppRemotePlaybackOptionsRepeatModeTrack = 1,
12
-
13
- /// Repeats the current context.
14
- SPTAppRemotePlaybackOptionsRepeatModeContext = 2,
15
- };
16
-
17
- /**
18
- * The `SPTAppRemotePlaybackOptions` describes a set of options used for the current playback.
19
- *
20
- * @discussion Use these to determine UI states.
21
- */
22
- @protocol SPTAppRemotePlaybackOptions <NSObject>
23
-
24
- /// `YES` if shuffle is enabled, otherwise `NO`.
25
- @property (nonatomic, readonly) BOOL isShuffling;
26
-
27
- /// The current repeat mode in effect.
28
- @property (nonatomic, readonly) SPTAppRemotePlaybackOptionsRepeatMode repeatMode;
29
-
30
- @end
31
-
32
- NS_ASSUME_NONNULL_END
@@ -1,32 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- * The `SPTAppRemotePlaybackRestrictions` describes a set of restrictions for playback in the Spotify client.
7
- *
8
- * @discussion Use these to determine whether to enable or disable certain actions in the UI.
9
- */
10
- @protocol SPTAppRemotePlaybackRestrictions <NSObject>
11
-
12
- /// `YES` if the user can skip to the next track, otherwise `NO`.
13
- @property (nonatomic, readonly) BOOL canSkipNext;
14
-
15
- /// `YES` if the user can skip to the previous track, otherwise `NO`.
16
- @property (nonatomic, readonly) BOOL canSkipPrevious;
17
-
18
- /// `YES` if the user can repeat the current track, otherwise `NO`.
19
- @property (nonatomic, readonly) BOOL canRepeatTrack;
20
-
21
- /// `YES` if the user can repeat the current context, otherwise `NO`.
22
- @property (nonatomic, readonly) BOOL canRepeatContext;
23
-
24
- /// `YES` if the user can toggle shuffle, otherwise `NO`.
25
- @property (nonatomic, readonly) BOOL canToggleShuffle;
26
-
27
- /// `YES` if the user can seek to specific positions, otherwise `NO`.
28
- @property (nonatomic, readonly) BOOL canSeek;
29
-
30
- @end
31
-
32
- NS_ASSUME_NONNULL_END
@@ -1,267 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "SPTAppRemoteCommon.h"
3
- #import "SPTAppRemotePlaybackOptions.h"
4
-
5
- @protocol SPTAppRemotePlayerState
6
- , SPTAppRemoteContentItem, SPTAppRemotePodcastPlaybackSpeed;
7
-
8
- NS_ASSUME_NONNULL_BEGIN
9
-
10
- /**
11
- * The `SPTAppRemotePlayerStateDelegate` is used to get notifications from the Spotify app when the player state is
12
- * changed.
13
- */
14
- @protocol SPTAppRemotePlayerStateDelegate <NSObject>
15
-
16
- /**
17
- * Called when the player state has been updated.
18
- *
19
- * @param playerState The new player state.
20
- */
21
- - (void)playerStateDidChange:(id<SPTAppRemotePlayerState>)playerState;
22
-
23
- @end
24
-
25
- /**
26
- * The `SPTAppRemotePlayerAPI` is used to interact with and control the Spotify player.
27
- */
28
- @protocol SPTAppRemotePlayerAPI <NSObject>
29
-
30
- /// The delegate receiving player state updates
31
- @property (nonatomic, weak) id<SPTAppRemotePlayerStateDelegate> delegate;
32
-
33
- #pragma mark Player Control
34
-
35
- /**
36
- * Asks the Spotify player to play the entity with the given identifier.
37
- *
38
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
39
- * the track begins to play.
40
- *
41
- * @param entityIdentifier The unique identifier of the entity to play.
42
- * @param callback On success `result` will be `YES`.
43
- * On error `result` will be `nil` and `error` set
44
- */
45
- - (void)play:(NSString *)entityIdentifier callback:(nullable SPTAppRemoteCallback)callback;
46
-
47
- /**
48
- * Asks the Spotify player to play the entity with the given identifier.
49
- *
50
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
51
- * the track begins to play.
52
- *
53
- * @param trackUri The track URI to play.
54
- * @param asRadio `YES` to start radio for track URI.
55
- * @param callback On success `result` will be `YES`.
56
- * On error `result` will be `nil` and `error` set
57
- */
58
- - (void)play:(NSString *)trackUri asRadio:(BOOL)asRadio callback:(SPTAppRemoteCallback)callback;
59
-
60
- /**
61
- * Asks the Spotify player to play the provided content item.
62
- *
63
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
64
- * the track begins to play.
65
- * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is
66
- * playable.
67
- *
68
- * @param contentItem The content item to play.
69
- * @param callback On success `result` will be `YES`.
70
- * On error `result` will be `nil` and error set
71
- */
72
- - (void)playItem:(id<SPTAppRemoteContentItem>)contentItem callback:(nullable SPTAppRemoteCallback)callback;
73
-
74
- /**
75
- * Asks the Spotify player to play the provided content item starting at the specified index.
76
- *
77
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
78
- * the track begins to play.
79
- * @note The `playable` property of the `SPTAppRemoteContentItem` indicates whether or not a content item is
80
- * playable.
81
- * @note Sending an `index` parameter that is out of bounds is undefined.
82
- *
83
- * @param contentItem The content item to play.
84
- * @param index The index of the track to skip to if applicable.
85
- * @param callback On success `result` will be `YES`.
86
- * On error `result` will be `nil` and error set
87
- */
88
- - (void)playItem:(id<SPTAppRemoteContentItem>)contentItem
89
- skipToTrackIndex:(NSInteger)index
90
- callback:(nullable SPTAppRemoteCallback)callback;
91
-
92
- /**
93
- * Asks the Spotify player to resume playback.
94
- *
95
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
96
- * the playback resumes.
97
- *
98
- * @param callback On success `result` will be `YES`.
99
- * On error `result` will be nil and error set
100
- */
101
- - (void)resume:(nullable SPTAppRemoteCallback)callback;
102
-
103
- /**
104
- * Asks the Spotify player to pause playback.
105
- *
106
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
107
- * the playback pauses.
108
- *
109
- * @param callback On success `result` will be `YES`.
110
- * On error `result` will be `nil` and error set
111
- */
112
- - (void)pause:(nullable SPTAppRemoteCallback)callback;
113
-
114
- /**
115
- * Asks the Spotify player to skip to the next track.
116
- *
117
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
118
- * the track changes.
119
- *
120
- * @param callback On success `result` will be `YES`.
121
- * On error `result` will be `nil` and error set
122
- */
123
- - (void)skipToNext:(nullable SPTAppRemoteCallback)callback;
124
-
125
- /**
126
- * Asks the Spotify player to skip to the previous track.
127
- *
128
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
129
- * the track changes.
130
- *
131
- * @param callback On success `result` will be `YES`.
132
- * On error `result` will be `nil` and `error` set
133
- */
134
- - (void)skipToPrevious:(nullable SPTAppRemoteCallback)callback;
135
-
136
- /**
137
- * Asks the Spotify player to seek to the specified position.
138
- *
139
- * @param position The position to seek to in milliseconds.
140
- * @param callback On success `result` will be `YES`.
141
- * On error `result` will be `nil` and `error` set
142
- */
143
- - (void)seekToPosition:(NSInteger)position callback:(nullable SPTAppRemoteCallback)callback;
144
-
145
- /**
146
- * Asks the Spotify player to seek forward 15 seconds.
147
- * Note: You should only use this method if isEpisode = YES for the currently playing track
148
- *
149
- * @param callback On success `result` will be `YES`.
150
- * On error `result` will be `nil` and `error` set
151
- */
152
- - (void)seekForward15Seconds:(nullable SPTAppRemoteCallback)callback;
153
-
154
- /**
155
- * Asks the Spotify player to seek backward 15 seconds.
156
- * Note: You should only use this method if isEpisode = YES for the currently playing track
157
- *
158
- * @param callback On success `result` will be `YES`.
159
- * On error `result` will be `nil` and `error` set
160
- */
161
- - (void)seekBackward15Seconds:(nullable SPTAppRemoteCallback)callback;
162
-
163
- #pragma mark Playback Options
164
-
165
- /**
166
- * Asks the Spotify player to set shuffle mode.
167
- *
168
- * @param shuffle `YES` to enable shuffle, `NO` to disable.
169
- * @param callback On success `result` will be `YES`.
170
- * On error `result` will be `nil` and `error` will be set.
171
- */
172
- - (void)setShuffle:(BOOL)shuffle callback:(nullable SPTAppRemoteCallback)callback;
173
-
174
- /**
175
- * Asks the Spotify player to set the repeat mode.
176
- *
177
- * @param repeatMode The repeat mode to set.
178
- * @param callback On success `result` will be `YES`.
179
- * On error `result` will be `nil` and `error` will be set.
180
- */
181
- - (void)setRepeatMode:(SPTAppRemotePlaybackOptionsRepeatMode)repeatMode
182
- callback:(nullable SPTAppRemoteCallback)callback;
183
-
184
- #pragma mark Player State
185
-
186
- /**
187
- * Asks the Spotify player for the current player state.
188
- *
189
- * @param callback On success `result` will be an instance of `id<SPTAppRemotePlayerState>`
190
- * On error `result` will be nil and error set
191
- */
192
- - (void)getPlayerState:(nullable SPTAppRemoteCallback)callback;
193
-
194
- /**
195
- * Subscribes to player state changes from the Spotify app.
196
- *
197
- * @note Implement `SPTAppRemotePlayerStateDelegate` and set yourself as delegate in order to be notified when the
198
- * the player state changes.
199
- *
200
- * @param callback On success `result` will be an instance of `id<SPTAppRemotePlayerState>`
201
- * On error `result` will be nil and error set
202
- */
203
- - (void)subscribeToPlayerState:(nullable SPTAppRemoteCallback)callback;
204
-
205
- /**
206
- * Stops subscribing to player state changes from the Spotify app.
207
- *
208
- * @param callback On success `result` will be `YES`
209
- * On error `result` will be `nil` and error set
210
- */
211
- - (void)unsubscribeToPlayerState:(nullable SPTAppRemoteCallback)callback;
212
-
213
- /**
214
- * Adds a track to the user's currently playing queue
215
- *
216
- * @param trackUri The track URI to add to the queue
217
- * @param callback On success `result` will be `YES`
218
- * On error `result` will be `nil` and error set
219
- */
220
- - (void)enqueueTrackUri:(NSString *)trackUri callback:(nullable SPTAppRemoteCallback)callback;
221
-
222
- /**
223
- * Asks the Spotify player for available podcast playback speeds
224
- *
225
- * @param callback On success `result` will be an `NSArray` of `SPTAppRemotePodcastPlaybackSpeed` objects
226
- * On error `result` will be `nil` and `error` set
227
- */
228
- - (void)getAvailablePodcastPlaybackSpeeds:(nullable SPTAppRemoteCallback)callback;
229
-
230
- /**
231
- * Asks the Spotify player for the current podcast playback speed
232
- *
233
- * @note Podcast playback speed is seperate from other contents' playback speed. This value is only used for podcasts
234
- *
235
- * @param callback On success `result` will be a `SPTAppRemotePodcastPlaybackSpeed`
236
- * On error `result` will be `nil` and `error` set
237
- */
238
- - (void)getCurrentPodcastPlaybackSpeed:(nullable SPTAppRemoteCallback)callback;
239
-
240
- /**
241
- * Set the current podcast playback speed
242
- *
243
- * @note This playback speed will only affect podcasts and not other types of media. If you set this
244
- * when a podcast is not playing this will be the default value when a podcast does begin to play. For this reason
245
- * you may get a successful callback when setting this even when a podcast is not playing and the current playback
246
- * speed does not change.
247
- *
248
- * @note You should use `getAvailablePodcastPlaybackSpeeds:` to get a list of valid speeds to pass to this method
249
- *
250
- * @param speed The `SPTAppRemotePodcastPlaybackSpeed` to set as the current podcast playback speed
251
- * @param callback On success `result` will be `YES`.
252
- * On error `result` will be `nil` and `error` set
253
- */
254
- - (void)setPodcastPlaybackSpeed:(nonnull id<SPTAppRemotePodcastPlaybackSpeed>)speed
255
- callback:(nullable SPTAppRemoteCallback)callback;
256
-
257
- /**
258
- * Asks the Spotify player for the current crossfade state.
259
- *
260
- * @param callback On success `result` will be an instance of `id<SPTAppRemoteCrossfadeState>`
261
- * On error `result` will be nil and error set
262
- */
263
- - (void)getCrossfadeState:(nullable SPTAppRemoteCallback)callback;
264
-
265
- @end
266
-
267
- NS_ASSUME_NONNULL_END
@@ -1,40 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- @protocol SPTAppRemoteTrack;
4
- @protocol SPTAppRemotePlaybackOptions;
5
- @protocol SPTAppRemotePlaybackRestrictions;
6
-
7
- NS_ASSUME_NONNULL_BEGIN
8
-
9
- /**
10
- * The `SPTAppRemotePlayerState` represents the state within the Spotify player.
11
- */
12
- @protocol SPTAppRemotePlayerState <NSObject>
13
-
14
- /// The track being played in the Spotify player.
15
- @property (nonatomic, readonly) id<SPTAppRemoteTrack> track;
16
-
17
- /// The position of the playback in the Spotify player.
18
- @property (nonatomic, readonly) NSInteger playbackPosition;
19
-
20
- /// The speed of the playback in the Spotify player.
21
- @property (nonatomic, readonly) float playbackSpeed;
22
-
23
- /// `YES` if the Spotify player is paused, otherwise `NO`.
24
- @property (nonatomic, readonly, getter=isPaused) BOOL paused;
25
-
26
- /// The playback restrictions currently in effect.
27
- @property (nonatomic, readonly) id<SPTAppRemotePlaybackRestrictions> playbackRestrictions;
28
-
29
- /// The playback options currently in effect.
30
- @property (nonatomic, readonly) id<SPTAppRemotePlaybackOptions> playbackOptions;
31
-
32
- /// The title of the currently playing context (e.g. the name of the playlist).
33
- @property (nonatomic, readonly) NSString *contextTitle;
34
-
35
- /// The URI of the currently playing context (e.g. the URI of the playlist).
36
- @property (nonatomic, readonly) NSURL *contextURI;
37
-
38
- @end
39
-
40
- NS_ASSUME_NONNULL_END
@@ -1,15 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- NS_ASSUME_NONNULL_BEGIN
4
-
5
- /**
6
- * The `SPTAppRemotePodcastPlaybackSpeed` represents playback speed(s) for podcasts
7
- */
8
- @protocol SPTAppRemotePodcastPlaybackSpeed <NSObject>
9
-
10
- /// The speed multiplier representing this podcast speed. 0.5 = half speed, 2 = twice as fast, 1 = normal playback
11
- @property (nonatomic, strong, readonly) NSNumber *value;
12
-
13
- @end
14
-
15
- NS_ASSUME_NONNULL_END