@wwdrew/expo-spotify-sdk 0.3.1 → 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.
Files changed (97) hide show
  1. package/README.md +36 -3
  2. package/build/ExpoSpotifySDK.types.d.ts +0 -1
  3. package/build/ExpoSpotifySDK.types.d.ts.map +1 -1
  4. package/build/ExpoSpotifySDK.types.js.map +1 -1
  5. package/external/android/SpotifySDK/auth-lib/spotify-auth-release-2.1.0.aar +0 -0
  6. package/ios/ExpoSpotifySDKModule.swift +1 -3
  7. package/ios/ExpoSpotifySessionManager.swift +3 -3
  8. package/ios/SpotifySDK/SpotifyiOS.xcframework/Info.plist +9 -5
  9. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemote.h +14 -10
  10. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +3 -0
  11. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSessionManager.h +3 -13
  12. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +2 -0
  13. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist +0 -0
  14. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Modules/module.modulemap +1 -1
  15. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/PrivacyInfo.xcprivacy +14 -0
  16. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS +0 -0
  17. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +14 -10
  18. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +3 -0
  19. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +3 -13
  20. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +2 -0
  21. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
  22. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +1 -1
  23. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/PrivacyInfo.xcprivacy +14 -0
  24. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
  25. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +20 -133
  26. package/package.json +4 -3
  27. package/plugin/build/android/withSpotifyAndroidAppBuildGradle.js +18 -2
  28. package/plugin/build/index.js +2 -2
  29. package/plugin/build/ios/{withSpotifyConfigIOS.d.ts → withSpotifyConfigValues.d.ts} +1 -1
  30. package/plugin/build/ios/{withSpotifyConfigIOS.js → withSpotifyConfigValues.js} +3 -3
  31. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -240
  32. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
  33. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
  34. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -36
  35. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
  36. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -75
  37. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -43
  38. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
  39. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
  40. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
  41. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
  42. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
  43. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
  44. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -262
  45. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
  46. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
  47. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -47
  48. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -103
  49. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
  50. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -63
  51. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTError.h +0 -33
  52. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
  53. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTMacros.h +0 -89
  54. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTScope.h +0 -68
  55. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSession.h +0 -32
  56. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -140
  57. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -30
  58. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
  59. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Info.plist +0 -0
  60. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Modules/module.modulemap +0 -6
  61. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/SpotifyiOS +0 -0
  62. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +0 -240
  63. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +0 -18
  64. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +0 -18
  65. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +0 -36
  66. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +0 -65
  67. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +0 -75
  68. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +0 -43
  69. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +0 -18
  70. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +0 -25
  71. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +0 -16
  72. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +0 -19
  73. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +0 -32
  74. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +0 -32
  75. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +0 -262
  76. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +0 -40
  77. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +0 -15
  78. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +0 -47
  79. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +0 -103
  80. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +0 -15
  81. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +0 -63
  82. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +0 -33
  83. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTLogin.h +0 -10
  84. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTMacros.h +0 -89
  85. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +0 -68
  86. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSession.h +0 -32
  87. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +0 -140
  88. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +0 -30
  89. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +0 -7
  90. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
  91. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +0 -6
  92. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
  93. package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +0 -537
  94. package/plugin/build/android/withSpotifyConfigAndroid.d.ts +0 -3
  95. package/plugin/build/android/withSpotifyConfigAndroid.js +0 -16
  96. package/plugin/build/withSpotifyConfig.d.ts +0 -3
  97. package/plugin/build/withSpotifyConfig.js +0 -11
package/README.md CHANGED
@@ -52,13 +52,15 @@ authenticateAsync(config: SpotifyConfig): Promise<SpotifySession>
52
52
 
53
53
  Starts the authentication process. Requires an array of OAuth scopes. If the Spotify app is installed on the target device it will interact directly with it, otherwise it will open a web view to authenticate with the Spotify website.
54
54
 
55
+ **Note for Android:** If not providing a token swap or refresh URL, the Spotify session response access token will expire after 60 minutes and will not include a refresh token. This is due to a limitation in the Android Spotify SDK. It's generally recommended to [implement a token swap endpoint](#token-swap) for this reason.
56
+
55
57
  ### Parameters
56
58
 
57
59
  - `tokenSwapURL` (optional): &lt;string&gt; The URL to use for attempting to swap an authorization code for an access token
58
60
  - `tokenRefreshURL` (optional): &lt;string&gt; The URL to use for attempting to renew an access token with a refresh token
59
61
  - `scopes`: An array of OAuth scopes that declare how your app wants to access a user's account. See [Spotify Scopes](https://developer.spotify.com/web-api/using-scopes/) for more information.
60
62
 
61
- **Note**: The following scopes are not available to Expo Spotify SDK:
63
+ **Note:** The following scopes are not available to Expo Spotify SDK:
62
64
 
63
65
  - user-read-playback-position
64
66
  - user-soa-link
@@ -78,9 +80,8 @@ interface SpotifyConfig {
78
80
 
79
81
  interface SpotifySession {
80
82
  accessToken: string;
81
- refreshToken: string;
83
+ refreshToken: string | null;
82
84
  expirationDate: number;
83
- isExpired: boolean;
84
85
  scopes: SpotifyScopes[];
85
86
  }
86
87
 
@@ -105,6 +106,38 @@ type SpotifyScopes =
105
106
  | "user-read-private";
106
107
  ```
107
108
 
109
+ ## Token Swap Example
110
+
111
+ An example token swap endpoint has been provided in the `example` project. For it to work it needs your Spotify client details to be included.
112
+
113
+ 1. Open the `server.js` file and add your client details:
114
+
115
+ ```javascript
116
+ const CLIENT_ID = "<your-client-id>";
117
+ const CLIENT_SECRET = "<your-client-secret>";
118
+ ```
119
+
120
+ These values can be found in your [Spotify Developer Dashboard](https://developer.spotify.com/dashboard). You will need an existing Spotify app for this.
121
+
122
+ 2. Run the server
123
+
124
+ ```sh
125
+ node server.js
126
+ ```
127
+
128
+ 3. Set the `tokenSwapURL` value in your `authenticateAsync` call:
129
+
130
+ ```javascript
131
+ const session = await authenticateAsync({
132
+ tokenSwapURL: "http://192.168.1.120:3000/swap",
133
+ scopes: [
134
+ ...
135
+ ]
136
+ });
137
+ ```
138
+
139
+ All authentication requests will now be sent through the token swap server.
140
+
108
141
  ## Acknowledgments
109
142
 
110
143
  This project has been heavily inspired by the following projects:
@@ -2,7 +2,6 @@ export interface SpotifySession {
2
2
  accessToken: string;
3
3
  refreshToken: string;
4
4
  expirationDate: number;
5
- isExpired: boolean;
6
5
  scopes: SpotifyScope[];
7
6
  }
8
7
  export interface SpotifyConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoSpotifySDK.types.d.ts","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GACpB,kBAAkB,GAClB,0BAA0B,GAC1B,4BAA4B,GAC5B,6BAA6B,GAC7B,oBAAoB,GACpB,WAAW,GACX,uBAAuB,GACvB,6BAA6B,GAC7B,yBAAyB,GACzB,wBAAwB,GACxB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,2BAA2B,GAC3B,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,CAAC"}
1
+ {"version":3,"file":"ExpoSpotifySDK.types.d.ts","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD,MAAM,MAAM,YAAY,GACpB,kBAAkB,GAClB,0BAA0B,GAC1B,4BAA4B,GAC5B,6BAA6B,GAC7B,oBAAoB,GACpB,WAAW,GACX,uBAAuB,GACvB,6BAA6B,GAC7B,yBAAyB,GACzB,wBAAwB,GACxB,oBAAoB,GACpB,kBAAkB,GAClB,eAAe,GACf,2BAA2B,GAC3B,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoSpotifySDK.types.js","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SpotifySession {\n accessToken: string;\n refreshToken: string;\n expirationDate: number;\n isExpired: boolean;\n scopes: SpotifyScope[];\n}\n\nexport interface SpotifyConfig {\n scopes: SpotifyScope[];\n tokenSwapURL?: string;\n tokenRefreshURL?: string;\n}\n\nexport type SpotifyScope =\n | \"ugc-image-upload\"\n | \"user-read-playback-state\"\n | \"user-modify-playback-state\"\n | \"user-read-currently-playing\"\n | \"app-remote-control\"\n | \"streaming\"\n | \"playlist-read-private\"\n | \"playlist-read-collaborative\"\n | \"playlist-modify-private\"\n | \"playlist-modify-public\"\n | \"user-follow-modify\"\n | \"user-follow-read\"\n | \"user-top-read\"\n | \"user-read-recently-played\"\n | \"user-library-modify\"\n | \"user-library-read\"\n | \"user-read-email\"\n | \"user-read-private\";\n"]}
1
+ {"version":3,"file":"ExpoSpotifySDK.types.js","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SpotifySession {\n accessToken: string;\n refreshToken: string;\n expirationDate: number;\n scopes: SpotifyScope[];\n}\n\nexport interface SpotifyConfig {\n scopes: SpotifyScope[];\n tokenSwapURL?: string;\n tokenRefreshURL?: string;\n}\n\n// export interface AndroidSpotifyConfig extends SpotifyConfig {\n// responseType: \"token\" | \"code\";\n// }\n\nexport type SpotifyScope =\n | \"ugc-image-upload\"\n | \"user-read-playback-state\"\n | \"user-modify-playback-state\"\n | \"user-read-currently-playing\"\n | \"app-remote-control\"\n | \"streaming\"\n | \"playlist-read-private\"\n | \"playlist-read-collaborative\"\n | \"playlist-modify-private\"\n | \"playlist-modify-public\"\n | \"user-follow-modify\"\n | \"user-follow-read\"\n | \"user-top-read\"\n | \"user-read-recently-played\"\n | \"user-library-modify\"\n | \"user-library-read\"\n | \"user-read-email\"\n | \"user-read-private\";\n"]}
@@ -27,13 +27,11 @@ public class ExpoSpotifySDKModule: Module {
27
27
  "accessToken": session.accessToken,
28
28
  "refreshToken": session.refreshToken,
29
29
  "expirationDate": Int(session.expirationDate.timeIntervalSince1970 * 1000),
30
- "scopes": SPTScopeSerializer.serializeScopes(session.scope),
31
- "isExpired": session.isExpired
30
+ "scopes": SPTScopeSerializer.serializeScopes(session.scope)
32
31
  ])
33
32
  }.catch { error in
34
33
  promise.reject(error)
35
34
  }
36
35
  }
37
-
38
36
  }
39
37
  }
@@ -46,8 +46,8 @@ final class ExpoSpotifySessionManager: NSObject {
46
46
 
47
47
  func authenticate(scopes: [String], tokenSwapURL: String?, tokenRefreshURL: String?) -> PromiseKit.Promise<SPTSession> {
48
48
  return Promise { seal in
49
- guard let clientID = expoSpotifyConfiguration?.clientID,
50
- let redirectURL = expoSpotifyConfiguration?.redirectURL else {
49
+ guard let clientID = self.expoSpotifyConfiguration?.clientID,
50
+ let redirectURL = self.expoSpotifyConfiguration?.redirectURL else {
51
51
  NSLog("Invalid Spotify configuration")
52
52
  seal.reject(SessionManagerError.invalidConfiguration)
53
53
  return
@@ -68,7 +68,7 @@ final class ExpoSpotifySessionManager: NSObject {
68
68
  self.sessionManager = SPTSessionManager(configuration: configuration, delegate: self)
69
69
 
70
70
  DispatchQueue.main.sync {
71
- sessionManager?.initiateSession(with: SPTScopeSerializer.deserializeScopes(scopes), options: .default)
71
+ sessionManager?.initiateSession(with: SPTScopeSerializer.deserializeScopes(scopes), options: .default, campaign: nil)
72
72
  }
73
73
  }
74
74
  }
@@ -5,31 +5,35 @@
5
5
  <key>AvailableLibraries</key>
6
6
  <array>
7
7
  <dict>
8
+ <key>BinaryPath</key>
9
+ <string>SpotifyiOS.framework/SpotifyiOS</string>
8
10
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64</string>
11
+ <string>ios-arm64_x86_64-simulator</string>
10
12
  <key>LibraryPath</key>
11
13
  <string>SpotifyiOS.framework</string>
12
14
  <key>SupportedArchitectures</key>
13
15
  <array>
14
16
  <string>arm64</string>
17
+ <string>x86_64</string>
15
18
  </array>
16
19
  <key>SupportedPlatform</key>
17
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
18
23
  </dict>
19
24
  <dict>
25
+ <key>BinaryPath</key>
26
+ <string>SpotifyiOS.framework/SpotifyiOS</string>
20
27
  <key>LibraryIdentifier</key>
21
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
22
29
  <key>LibraryPath</key>
23
30
  <string>SpotifyiOS.framework</string>
24
31
  <key>SupportedArchitectures</key>
25
32
  <array>
26
33
  <string>arm64</string>
27
- <string>x86_64</string>
28
34
  </array>
29
35
  <key>SupportedPlatform</key>
30
36
  <string>ios</string>
31
- <key>SupportedPlatformVariant</key>
32
- <string>simulator</string>
33
37
  </dict>
34
38
  </array>
35
39
  <key>CFBundlePackageType</key>
@@ -166,24 +166,26 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
166
166
  * The passed URI will start playing unless Spotify is already playing.
167
167
  *
168
168
  * @param URI The URI to play. Use a blank string to attempt to play the user's last song
169
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
169
170
  *
170
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
171
171
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
172
172
  * the Spotify app is installed and can attempt to handle the authorization request.
173
173
  */
174
- - (BOOL)authorizeAndPlayURI:(NSString *)URI;
174
+ - (void)authorizeAndPlayURI:(NSString *)URI completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
175
175
 
176
176
  /**
177
177
  * Open Spotify app to obtain access token and start playback.
178
178
  *
179
179
  * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
180
180
  * @param asRadio `YES` to start radio for the given URI.
181
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
181
182
  *
182
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
183
183
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
184
184
  * the Spotify app is installed and can attempt to handle the authorization request.
185
185
  */
186
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI asRadio:(BOOL)asRadio;
186
+ - (void)authorizeAndPlayURI:(NSString *)playURI
187
+ asRadio:(BOOL)asRadio
188
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
187
189
 
188
190
  /**
189
191
  * Open Spotify app to obtain access token and start playback.
@@ -191,14 +193,15 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
191
193
  * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
192
194
  * @param asRadio `YES` to start radio for the given URI.
193
195
  * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control`
196
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
194
197
  *
195
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
196
198
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
197
199
  * the Spotify app is installed and can attempt to handle the authorization request.
198
200
  */
199
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI
201
+ - (void)authorizeAndPlayURI:(NSString *)playURI
200
202
  asRadio:(BOOL)asRadio
201
- additionalScopes:(nullable NSArray<NSString *> *)additionalScopes;
203
+ additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
204
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
202
205
 
203
206
  /**
204
207
  * Open Spotify app to obtain access token and start playback.
@@ -209,15 +212,16 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
209
212
  * @param sessionIdentifier An optional unique identifier for this specific session, which is used for analytics purposes. Every new attempt to
210
213
  * connect to the Spotify app should have a new identifier, but the identifier used here should then be reused for the accompanied call to
211
214
  * `connectWithSessionIdentifier:`.
215
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
212
216
  *
213
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
214
217
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
215
218
  * the Spotify app is installed and can attempt to handle the authorization request.
216
219
  */
217
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI
220
+ - (void)authorizeAndPlayURI:(NSString *)playURI
218
221
  asRadio:(BOOL)asRadio
219
222
  additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
220
- sessionIdentifier:(nullable NSUUID *)sessionIdentifier;
223
+ sessionIdentifier:(nullable NSUUID *)sessionIdentifier
224
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
221
225
  /**
222
226
  * Parse out an access token or error description from a url passed to application:openURL:options:
223
227
  *
@@ -33,6 +33,9 @@ NS_ASSUME_NONNULL_BEGIN
33
33
  /// Returns `YES` if the item is expected to contain children, otherwise `NO`.
34
34
  @property (nonatomic, assign, readonly, getter=isContainer) BOOL container;
35
35
 
36
+ /// Returns `YES` if the item is pinned in Your Library, otherwise `NO`.
37
+ @property (nonatomic, assign, readonly, getter=isPinned) BOOL pinnned;
38
+
36
39
  /**
37
40
  A list of the content item's children.
38
41
 
@@ -44,26 +44,16 @@ typedef NSString * const SPTAuthorizationCode;
44
44
  - (instancetype)init NS_UNAVAILABLE;
45
45
 
46
46
  /**
47
- Initiate the authorization process on iOS 11 and later.
47
+ Initiate the authorization process
48
48
 
49
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
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
51
+ @param campaign The campaign identifier, to help attribute where the account linking was initiated from.
62
52
  See `SPTSessionManagerDelegate` for messages regarding changes in session state.
63
53
  */
64
54
  - (void)initiateSessionWithScope:(SPTScope)scope
65
55
  options:(SPTAuthorizationOptions)options
66
- presentingViewController: (UIViewController *)presentingViewController NS_DEPRECATED_IOS(9_0, 11_0);
56
+ campaign:(nullable NSString *)campaign;
67
57
 
68
58
  /// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid.
69
59
  - (void)renewSession;
@@ -24,6 +24,8 @@
24
24
  #import "SPTAppRemoteLibraryState.h"
25
25
  #import "SPTAppRemoteContentItem.h"
26
26
  #import "SPTAppRemotePodcastPlaybackSpeed.h"
27
+ #import "SPTAppRemoteConnectivityAPI.h"
28
+ #import "SPTAppRemoteConnectivityState.h"
27
29
 
28
30
  #import "SPTConfiguration.h"
29
31
 
@@ -1,6 +1,6 @@
1
1
  framework module SpotifyiOS {
2
2
  umbrella header "SpotifyiOS.h"
3
-
4
3
  export *
4
+
5
5
  module * { export * }
6
6
  }
@@ -0,0 +1,14 @@
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>
@@ -166,24 +166,26 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
166
166
  * The passed URI will start playing unless Spotify is already playing.
167
167
  *
168
168
  * @param URI The URI to play. Use a blank string to attempt to play the user's last song
169
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
169
170
  *
170
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
171
171
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
172
172
  * the Spotify app is installed and can attempt to handle the authorization request.
173
173
  */
174
- - (BOOL)authorizeAndPlayURI:(NSString *)URI;
174
+ - (void)authorizeAndPlayURI:(NSString *)URI completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
175
175
 
176
176
  /**
177
177
  * Open Spotify app to obtain access token and start playback.
178
178
  *
179
179
  * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
180
180
  * @param asRadio `YES` to start radio for the given URI.
181
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
181
182
  *
182
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
183
183
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
184
184
  * the Spotify app is installed and can attempt to handle the authorization request.
185
185
  */
186
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI asRadio:(BOOL)asRadio;
186
+ - (void)authorizeAndPlayURI:(NSString *)playURI
187
+ asRadio:(BOOL)asRadio
188
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
187
189
 
188
190
  /**
189
191
  * Open Spotify app to obtain access token and start playback.
@@ -191,14 +193,15 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
191
193
  * @param playURI The URI to play. Use a blank string to attempt to play the user's last song
192
194
  * @param asRadio `YES` to start radio for the given URI.
193
195
  * @param additionalScopes An array of scopes in addition to `app-remote-control`. Can be nil if you only need `app-remote-control`
196
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
194
197
  *
195
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
196
198
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
197
199
  * the Spotify app is installed and can attempt to handle the authorization request.
198
200
  */
199
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI
201
+ - (void)authorizeAndPlayURI:(NSString *)playURI
200
202
  asRadio:(BOOL)asRadio
201
- additionalScopes:(nullable NSArray<NSString *> *)additionalScopes;
203
+ additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
204
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
202
205
 
203
206
  /**
204
207
  * Open Spotify app to obtain access token and start playback.
@@ -209,15 +212,16 @@ typedef NS_ENUM(NSUInteger, SPTAppRemoteLogLevel) {
209
212
  * @param sessionIdentifier An optional unique identifier for this specific session, which is used for analytics purposes. Every new attempt to
210
213
  * connect to the Spotify app should have a new identifier, but the identifier used here should then be reused for the accompanied call to
211
214
  * `connectWithSessionIdentifier:`.
215
+ * @param completionHandler `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
212
216
  *
213
- * @return `YES` if the Spotify app is installed and an authorization attempt can be made, otherwise `NO`.
214
217
  * Note: The return `BOOL` here is not a measure of whether or not authentication succeeded, only a check if
215
218
  * the Spotify app is installed and can attempt to handle the authorization request.
216
219
  */
217
- - (BOOL)authorizeAndPlayURI:(NSString *)playURI
220
+ - (void)authorizeAndPlayURI:(NSString *)playURI
218
221
  asRadio:(BOOL)asRadio
219
222
  additionalScopes:(nullable NSArray<NSString *> *)additionalScopes
220
- sessionIdentifier:(nullable NSUUID *)sessionIdentifier;
223
+ sessionIdentifier:(nullable NSUUID *)sessionIdentifier
224
+ completionHandler:(void (^ __nullable)(BOOL success))completionHandler;
221
225
  /**
222
226
  * Parse out an access token or error description from a url passed to application:openURL:options:
223
227
  *
@@ -33,6 +33,9 @@ NS_ASSUME_NONNULL_BEGIN
33
33
  /// Returns `YES` if the item is expected to contain children, otherwise `NO`.
34
34
  @property (nonatomic, assign, readonly, getter=isContainer) BOOL container;
35
35
 
36
+ /// Returns `YES` if the item is pinned in Your Library, otherwise `NO`.
37
+ @property (nonatomic, assign, readonly, getter=isPinned) BOOL pinnned;
38
+
36
39
  /**
37
40
  A list of the content item's children.
38
41
 
@@ -44,26 +44,16 @@ typedef NSString * const SPTAuthorizationCode;
44
44
  - (instancetype)init NS_UNAVAILABLE;
45
45
 
46
46
  /**
47
- Initiate the authorization process on iOS 11 and later.
47
+ Initiate the authorization process
48
48
 
49
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
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
51
+ @param campaign The campaign identifier, to help attribute where the account linking was initiated from.
62
52
  See `SPTSessionManagerDelegate` for messages regarding changes in session state.
63
53
  */
64
54
  - (void)initiateSessionWithScope:(SPTScope)scope
65
55
  options:(SPTAuthorizationOptions)options
66
- presentingViewController: (UIViewController *)presentingViewController NS_DEPRECATED_IOS(9_0, 11_0);
56
+ campaign:(nullable NSString *)campaign;
67
57
 
68
58
  /// Attempt to renew the access token, using the refresh token in the current `SPTSession` which must be valid.
69
59
  - (void)renewSession;
@@ -24,6 +24,8 @@
24
24
  #import "SPTAppRemoteLibraryState.h"
25
25
  #import "SPTAppRemoteContentItem.h"
26
26
  #import "SPTAppRemotePodcastPlaybackSpeed.h"
27
+ #import "SPTAppRemoteConnectivityAPI.h"
28
+ #import "SPTAppRemoteConnectivityState.h"
27
29
 
28
30
  #import "SPTConfiguration.h"
29
31
 
@@ -1,6 +1,6 @@
1
1
  framework module SpotifyiOS {
2
2
  umbrella header "SpotifyiOS.h"
3
-
4
3
  export *
4
+
5
5
  module * { export * }
6
6
  }
@@ -0,0 +1,14 @@
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>