@wwdrew/expo-spotify-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -0
- package/README.md +113 -0
- package/app.plugin.js +1 -0
- package/build/ExpoSpotifySDK.types.d.ts +4 -0
- package/build/ExpoSpotifySDK.types.d.ts.map +1 -0
- package/build/ExpoSpotifySDK.types.js +2 -0
- package/build/ExpoSpotifySDK.types.js.map +1 -0
- package/build/ExpoSpotifySDKModule.d.ts +3 -0
- package/build/ExpoSpotifySDKModule.d.ts.map +1 -0
- package/build/ExpoSpotifySDKModule.js +5 -0
- package/build/ExpoSpotifySDKModule.js.map +1 -0
- package/build/ExpoSpotifySDKModule.web.d.ts +7 -0
- package/build/ExpoSpotifySDKModule.web.d.ts.map +1 -0
- package/build/ExpoSpotifySDKModule.web.js +12 -0
- package/build/ExpoSpotifySDKModule.web.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +12 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +10 -0
- package/ios/ExpoSpotifyAuthDelegate.swift +11 -0
- package/ios/ExpoSpotifyConfiguration.swift +25 -0
- package/ios/ExpoSpotifySDK.podspec +30 -0
- package/ios/ExpoSpotifySDKModule.swift +32 -0
- package/ios/ExpoSpotifySessionManager+SessionManagerDelegate.swift +16 -0
- package/ios/ExpoSpotifySessionManager.swift +82 -0
- package/ios/SPTScopeSerializer.swift +44 -0
- package/ios/SpotifySDK/Licenses/MPMessagePack-LICENSE.md +20 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/Info.plist +40 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemote.h +281 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +36 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +65 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h +54 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +76 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +46 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +25 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +16 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +19 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +262 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +40 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +52 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +103 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTConfiguration.h +66 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTError.h +33 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTLogin.h +10 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTMacros.h +89 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTScope.h +71 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSession.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SPTSessionManager.h +140 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +30 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Headers/SpotifyiOS.h +7 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/Modules/module.modulemap +6 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemote.h +240 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +36 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +65 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +75 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +43 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +25 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +16 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +19 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +262 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +40 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +47 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +103 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTConfiguration.h +63 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTError.h +33 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTLogin.h +10 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTMacros.h +89 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTScope.h +68 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSession.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SPTSessionManager.h +140 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +30 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Headers/SpotifyiOS.h +7 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/Modules/module.modulemap +6 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_armv7/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +240 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +36 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +65 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +75 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +43 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +25 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +16 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +19 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +262 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +40 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +47 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +103 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +63 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +33 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTLogin.h +10 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTMacros.h +89 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +68 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSession.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +140 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +30 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +7 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +6 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_i386_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +537 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemote.h +281 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteAlbum.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteArtist.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCommon.h +36 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectionParams.h +65 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityAPI.h +54 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteConnectivityState.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentAPI.h +76 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteContentItem.h +46 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteCrossfadeState.h +18 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageAPI.h +25 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteImageRepresentable.h +16 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteLibraryState.h +19 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackOptions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlaybackRestrictions.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerAPI.h +262 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePlayerState.h +40 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemotePodcastPlaybackSpeed.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteTrack.h +52 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserAPI.h +103 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTAppRemoteUserCapabilities.h +15 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTConfiguration.h +66 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTError.h +33 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTLogin.h +10 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTMacros.h +89 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTScope.h +71 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSession.h +32 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SPTSessionManager.h +140 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyAppRemote.h +30 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Headers/SpotifyiOS.h +7 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Info.plist +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/Modules/module.modulemap +6 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/SpotifyiOS +0 -0
- package/ios/SpotifySDK/SpotifyiOS.xcframework/ios-arm64_x86_64-simulator/SpotifyiOS.framework/_CodeSignature/CodeResources +567 -0
- package/package.json +58 -0
- package/plugin/build/android/withSpotifyAndroidAppBuildGradle.d.ts +3 -0
- package/plugin/build/android/withSpotifyAndroidAppBuildGradle.js +16 -0
- package/plugin/build/android/withSpotifyConfigAndroid.d.ts +3 -0
- package/plugin/build/android/withSpotifyConfigAndroid.js +16 -0
- package/plugin/build/index.d.ts +4 -0
- package/plugin/build/index.js +24 -0
- package/plugin/build/ios/withSpotifyConfigIOS.d.ts +3 -0
- package/plugin/build/ios/withSpotifyConfigIOS.js +16 -0
- package/plugin/build/ios/withSpotifyQueryScheme.d.ts +3 -0
- package/plugin/build/ios/withSpotifyQueryScheme.js +15 -0
- package/plugin/build/ios/withSpotifyURLScheme.d.ts +3 -0
- package/plugin/build/ios/withSpotifyURLScheme.js +19 -0
- package/plugin/build/types.d.ts +8 -0
- package/plugin/build/types.js +21 -0
- package/plugin/build/withSpotifyConfig.d.ts +3 -0
- package/plugin/build/withSpotifyConfig.js +11 -0
- package/server.js +93 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# expo-spotify-sdk
|
|
2
|
+
|
|
3
|
+
An Expo Module for the native [iOS](https://github.com/spotify/ios-sdk/) and [Android](https://github.com/spotify/android-sdk/) Spotify SDK
|
|
4
|
+
|
|
5
|
+
## Supported Features
|
|
6
|
+
|
|
7
|
+
- Authentication (currently iOS only, Android coming soon)
|
|
8
|
+
|
|
9
|
+
More to come...
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npx expo install @wwdrew/expo-spotify-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Configuration
|
|
18
|
+
|
|
19
|
+
Include the `expo-spotify-sdk` plugin in your `app.json/app.config.js` file with its required configuration:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
...
|
|
23
|
+
"plugins": [
|
|
24
|
+
["@wwdrew/expo-spotify-sdk", {
|
|
25
|
+
"clientID": "<your-spotify-client-id>",
|
|
26
|
+
"scheme": "expo-spotify-sdk-example",
|
|
27
|
+
"host": "authenticate",
|
|
28
|
+
"tokenSwapURL": "http://192.168.0.5:3000/swap",
|
|
29
|
+
"tokenRefreshURL": "http://192.168.0.5:3000/swap"
|
|
30
|
+
}]
|
|
31
|
+
],
|
|
32
|
+
...
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Required:
|
|
36
|
+
|
|
37
|
+
- `clientID`: <string> the Spotify Client ID for your application
|
|
38
|
+
- `scheme`: <string> the [URL scheme](https://docs.expo.dev/versions/latest/config/app/#scheme) to link into your app as part of the redirect URI
|
|
39
|
+
- `host`: <string> the path of the redirect URI
|
|
40
|
+
- `tokenSwapURL` (optional): <string> The URL to use for attempting to swap an authorization code for an access token
|
|
41
|
+
- `tokenRefreshURL` (optional): <string> The URL to use for attempting to renew an access token with a refresh token
|
|
42
|
+
|
|
43
|
+
## API Reference
|
|
44
|
+
|
|
45
|
+
`isAvailable(): boolean`
|
|
46
|
+
|
|
47
|
+
Determines if the Spotify app is installed on the target device.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
`authenticateAsync(scopes: SpotifyScope[]): Promise<SpotifySesson>`
|
|
52
|
+
|
|
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
|
+
|
|
55
|
+
### Parameters
|
|
56
|
+
|
|
57
|
+
- `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.
|
|
58
|
+
|
|
59
|
+
**Note**: The following scopes are not available to Expo Spotify SDK:
|
|
60
|
+
|
|
61
|
+
- user-read-playback-position
|
|
62
|
+
- user-soa-link
|
|
63
|
+
- user-soa-unlink
|
|
64
|
+
- user-manage-entitlements
|
|
65
|
+
- user-manage-partner
|
|
66
|
+
- user-create-partner
|
|
67
|
+
|
|
68
|
+
### Types
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
interface SpotifySession {
|
|
72
|
+
accessToken: string;
|
|
73
|
+
refreshToken: string;
|
|
74
|
+
expirationDate: number;
|
|
75
|
+
isExpired: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type SpotifyScopes =
|
|
79
|
+
| "ugc-image-upload"
|
|
80
|
+
| "user-read-playback-state"
|
|
81
|
+
| "user-modify-playback-state"
|
|
82
|
+
| "user-read-currently-playing"
|
|
83
|
+
| "app-remote-control"
|
|
84
|
+
| "streaming"
|
|
85
|
+
| "playlist-read-private"
|
|
86
|
+
| "playlist-read-collaborative"
|
|
87
|
+
| "playlist-modify-private"
|
|
88
|
+
| "playlist-modify-public"
|
|
89
|
+
| "user-follow-modify"
|
|
90
|
+
| "user-follow-read"
|
|
91
|
+
| "user-top-read"
|
|
92
|
+
| "user-read-recently-played"
|
|
93
|
+
| "user-library-modify"
|
|
94
|
+
| "user-library-read"
|
|
95
|
+
| "user-read-email"
|
|
96
|
+
| "user-read-private";
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Acknowledgments
|
|
101
|
+
|
|
102
|
+
This project has been heavily inspired by the following projects.
|
|
103
|
+
|
|
104
|
+
* [react-native-spotify-remote](https://github.com/cjam/react-native-spotify-remote)
|
|
105
|
+
* [expo-spotify](https://github.com/kvbalib/expo-spotify)
|
|
106
|
+
|
|
107
|
+
## Contribute
|
|
108
|
+
|
|
109
|
+
Contributions are welcome!
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
package/app.plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("./plugin/build");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDK.types.d.ts","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDK.types.js","sourceRoot":"","sources":["../src/ExpoSpotifySDK.types.ts"],"names":[],"mappings":"","sourcesContent":["export type ChangeEventPayload = {\n value: string;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDKModule.d.ts","sourceRoot":"","sources":["../src/ExpoSpotifySDKModule.ts"],"names":[],"mappings":";AAIA,wBAAqD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { requireNativeModule } from "expo-modules-core";
|
|
2
|
+
// It loads the native module object from the JSI or falls back to
|
|
3
|
+
// the bridge module (from NativeModulesProxy) if the remote debugger is on.
|
|
4
|
+
export default requireNativeModule("ExpoSpotifySDK");
|
|
5
|
+
//# sourceMappingURL=ExpoSpotifySDKModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDKModule.js","sourceRoot":"","sources":["../src/ExpoSpotifySDKModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,kEAAkE;AAClE,4EAA4E;AAC5E,eAAe,mBAAmB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from \"expo-modules-core\";\n\n// It loads the native module object from the JSI or falls back to\n// the bridge module (from NativeModulesProxy) if the remote debugger is on.\nexport default requireNativeModule(\"ExpoSpotifySDK\");\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDKModule.web.d.ts","sourceRoot":"","sources":["../src/ExpoSpotifySDKModule.web.ts"],"names":[],"mappings":";;yBAM6B,MAAM,GAAG,QAAQ,IAAI,CAAC;;;AAFnD,wBAQE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventEmitter } from "expo-modules-core";
|
|
2
|
+
const emitter = new EventEmitter({});
|
|
3
|
+
export default {
|
|
4
|
+
PI: Math.PI,
|
|
5
|
+
async setValueAsync(value) {
|
|
6
|
+
emitter.emit("onChange", { value });
|
|
7
|
+
},
|
|
8
|
+
hello() {
|
|
9
|
+
return "Hello world! 👋";
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=ExpoSpotifySDKModule.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoSpotifySDKModule.web.js","sourceRoot":"","sources":["../src/ExpoSpotifySDKModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,EAAS,CAAC,CAAC;AAE5C,eAAe;IACb,EAAE,EAAE,IAAI,CAAC,EAAE;IACX,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,KAAK;QACH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAC","sourcesContent":["import { EventEmitter } from \"expo-modules-core\";\n\nconst emitter = new EventEmitter({} as any);\n\nexport default {\n PI: Math.PI,\n async setValueAsync(value: string): Promise<void> {\n emitter.emit(\"onChange\", { value });\n },\n hello() {\n return \"Hello world! 👋\";\n },\n};\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface SpotifySession {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
refreshToken: string;
|
|
4
|
+
expirationDate: number;
|
|
5
|
+
isExpired: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare function isAvailable(): boolean;
|
|
8
|
+
declare function authenticateAsync(scopes: string[]): Promise<SpotifySession>;
|
|
9
|
+
declare const Authenticate: {
|
|
10
|
+
authenticateAsync: typeof authenticateAsync;
|
|
11
|
+
};
|
|
12
|
+
export { isAvailable, Authenticate };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,iBAAS,WAAW,IAAI,OAAO,CAE9B;AAED,iBAAS,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAEpE;AAED,QAAA,MAAM,YAAY;;CAEjB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ExpoSpotifySDKModule from "./ExpoSpotifySDKModule";
|
|
2
|
+
function isAvailable() {
|
|
3
|
+
return ExpoSpotifySDKModule.isAvailable();
|
|
4
|
+
}
|
|
5
|
+
function authenticateAsync(scopes) {
|
|
6
|
+
return ExpoSpotifySDKModule.authenticate(scopes);
|
|
7
|
+
}
|
|
8
|
+
const Authenticate = {
|
|
9
|
+
authenticateAsync,
|
|
10
|
+
};
|
|
11
|
+
export { isAvailable, Authenticate };
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAS1D,SAAS,WAAW;IAClB,OAAO,oBAAoB,CAAC,WAAW,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAgB;IACzC,OAAO,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,YAAY,GAAG;IACnB,iBAAiB;CAClB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import ExpoSpotifySDKModule from \"./ExpoSpotifySDKModule\";\n\ninterface SpotifySession {\n accessToken: string;\n refreshToken: string;\n expirationDate: number;\n isExpired: boolean;\n}\n\nfunction isAvailable(): boolean {\n return ExpoSpotifySDKModule.isAvailable();\n}\n\nfunction authenticateAsync(scopes: string[]): Promise<SpotifySession> {\n return ExpoSpotifySDKModule.authenticate(scopes);\n}\n\nconst Authenticate = {\n authenticateAsync,\n};\n\nexport { isAvailable, Authenticate };\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import SpotifyiOS
|
|
3
|
+
|
|
4
|
+
public class ExpoSpotifyAuthDelegate: ExpoAppDelegateSubscriber {
|
|
5
|
+
let sessionManager = ExpoSpotifySessionManager.shared
|
|
6
|
+
|
|
7
|
+
public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
|
|
8
|
+
sessionManager.sessionManager?.application(app, open: url, options: options)
|
|
9
|
+
return true
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import SpotifyiOS
|
|
2
|
+
|
|
3
|
+
struct ExpoSpotifyConfiguration: Codable {
|
|
4
|
+
let clientID: String
|
|
5
|
+
let host: String
|
|
6
|
+
let scheme: String
|
|
7
|
+
let tokenRefreshURL: URL?
|
|
8
|
+
let tokenSwapURL: URL?
|
|
9
|
+
|
|
10
|
+
var redirectURL: URL? {
|
|
11
|
+
return URL(string: "\(scheme)://\(host)")
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
init(clientID: String = "defaultClientID",
|
|
15
|
+
host: String = "defaultHost",
|
|
16
|
+
scheme: String = "defaultScheme",
|
|
17
|
+
tokenRefreshURL: URL? = nil,
|
|
18
|
+
tokenSwapURL: URL? = nil) {
|
|
19
|
+
self.clientID = clientID
|
|
20
|
+
self.host = host
|
|
21
|
+
self.scheme = scheme
|
|
22
|
+
self.tokenRefreshURL = tokenRefreshURL
|
|
23
|
+
self.tokenSwapURL = tokenSwapURL
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoSpotifySDK'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.description = package['description']
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platform = :ios, '13.0'
|
|
14
|
+
s.swift_version = '5.4'
|
|
15
|
+
s.source = { git: 'https://github.com/wwdrew/expo-spotify-sdk' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency 'PromiseKit', "~> 6.8"
|
|
20
|
+
|
|
21
|
+
# Swift/Objective-C compatibility
|
|
22
|
+
s.pod_target_xcconfig = {
|
|
23
|
+
'DEFINES_MODULE' => 'YES',
|
|
24
|
+
'SWIFT_COMPILATION_MODE' => 'wholemodule'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
s.source_files = "**/*.{h,m,swift}"
|
|
28
|
+
s.exclude_files = "SpotifySDK/SpotifyiOS.xcframework/**/*.h"
|
|
29
|
+
s.vendored_frameworks = "SpotifySDK/SpotifyiOS.xcframework"
|
|
30
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import SpotifyiOS
|
|
3
|
+
|
|
4
|
+
public class ExpoSpotifySDKModule: Module {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
public func definition() -> ModuleDefinition {
|
|
8
|
+
|
|
9
|
+
let spotifySession = ExpoSpotifySessionManager.shared
|
|
10
|
+
|
|
11
|
+
Name("ExpoSpotifySDK")
|
|
12
|
+
|
|
13
|
+
Function("isAvailable") {
|
|
14
|
+
return spotifySession.spotifyAppInstalled()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
AsyncFunction("authenticate") { (scopes: [String], promise: Promise) in
|
|
18
|
+
spotifySession.authenticate(requestedScopes: scopes).done { session in
|
|
19
|
+
let sessionData: [String: Any] = [
|
|
20
|
+
"accessToken": session.accessToken,
|
|
21
|
+
"refreshToken": session.refreshToken,
|
|
22
|
+
"expirationDate": Int(session.expirationDate.timeIntervalSince1970 * 1000),
|
|
23
|
+
"scopes": SPTScopeSerializer.serializeScopes(session.scope),
|
|
24
|
+
"isExpired": session.isExpired
|
|
25
|
+
]
|
|
26
|
+
promise.resolve(sessionData)
|
|
27
|
+
}.catch { error in
|
|
28
|
+
promise.reject(error)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import SpotifyiOS
|
|
3
|
+
|
|
4
|
+
extension ExpoSpotifySessionManager: SPTSessionManagerDelegate {
|
|
5
|
+
public func sessionManager(manager _: SPTSessionManager, didInitiate session: SPTSession) {
|
|
6
|
+
authPromiseSeal?.fulfill(session)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
public func sessionManager(manager _: SPTSessionManager, didFailWith error: Error) {
|
|
10
|
+
authPromiseSeal?.reject(error)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public func sessionManager(manager _: SPTSessionManager, didRenew session: SPTSession) {
|
|
14
|
+
authPromiseSeal?.fulfill(session)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import SpotifyiOS
|
|
3
|
+
import PromiseKit
|
|
4
|
+
|
|
5
|
+
enum SessionManagerError: Error {
|
|
6
|
+
case notInitialized
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
final class ExpoSpotifySessionManager: NSObject {
|
|
10
|
+
weak var module: ExpoSpotifySDKModule?
|
|
11
|
+
var authPromiseSeal: Resolver<SPTSession>?
|
|
12
|
+
|
|
13
|
+
static let shared = ExpoSpotifySessionManager()
|
|
14
|
+
|
|
15
|
+
private var expoSpotifyConfiguration: ExpoSpotifyConfiguration? {
|
|
16
|
+
guard let expoSpotifySdkDict = Bundle.main.object(forInfoDictionaryKey: "ExpoSpotifySDK") as? [String: String],
|
|
17
|
+
let clientID = expoSpotifySdkDict["clientID"],
|
|
18
|
+
let host = expoSpotifySdkDict["host"],
|
|
19
|
+
let scheme = expoSpotifySdkDict["scheme"] else
|
|
20
|
+
{
|
|
21
|
+
return nil
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let tokenRefreshURL = URL(string: expoSpotifySdkDict["tokenRefreshURL"] ?? "")
|
|
25
|
+
let tokenSwapURL = URL(string: expoSpotifySdkDict["tokenSwapURL"] ?? "")
|
|
26
|
+
|
|
27
|
+
return ExpoSpotifyConfiguration(clientID: clientID, host: host, scheme: scheme, tokenRefreshURL: tokenRefreshURL, tokenSwapURL: tokenSwapURL)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
lazy var configuration: SPTConfiguration? = {
|
|
31
|
+
guard let clientID = expoSpotifyConfiguration?.clientID,
|
|
32
|
+
let redirectURL = expoSpotifyConfiguration?.redirectURL else {
|
|
33
|
+
NSLog("Invalid Spotify configuration")
|
|
34
|
+
return nil
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return SPTConfiguration(clientID: clientID, redirectURL: redirectURL)
|
|
38
|
+
}()
|
|
39
|
+
|
|
40
|
+
lazy var sessionManager: SPTSessionManager? = {
|
|
41
|
+
guard let configuration = configuration else {
|
|
42
|
+
return nil
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
configuration.tokenSwapURL = expoSpotifyConfiguration?.tokenSwapURL
|
|
46
|
+
configuration.tokenRefreshURL = expoSpotifyConfiguration?.tokenRefreshURL
|
|
47
|
+
|
|
48
|
+
return SPTSessionManager(configuration: configuration, delegate: self)
|
|
49
|
+
}()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
func authenticate(requestedScopes: [String]) -> PromiseKit.Promise<SPTSession> {
|
|
53
|
+
return Promise { seal in
|
|
54
|
+
guard let sessionManager = sessionManager else {
|
|
55
|
+
NSLog("Session manager not initialized")
|
|
56
|
+
seal.reject(SessionManagerError.notInitialized)
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
self.authPromiseSeal = seal
|
|
61
|
+
|
|
62
|
+
DispatchQueue.main.sync {
|
|
63
|
+
sessionManager.initiateSession(with: SPTScopeSerializer.deserializeScopes(requestedScopes), options: .default)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
func spotifyAppInstalled() -> Bool {
|
|
69
|
+
guard let sessionManager = sessionManager else {
|
|
70
|
+
NSLog("Session manager not initialized")
|
|
71
|
+
return false
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var isInstalled = false
|
|
75
|
+
|
|
76
|
+
DispatchQueue.main.sync {
|
|
77
|
+
isInstalled = sessionManager.isSpotifyAppInstalled
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return isInstalled
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import SpotifyiOS
|
|
2
|
+
|
|
3
|
+
class SPTScopeSerializer {
|
|
4
|
+
static let scopeMap: [String: SPTScope] = [
|
|
5
|
+
"playlist-read-private": .playlistReadPrivate,
|
|
6
|
+
"playlist-read-collaborative": .playlistReadCollaborative,
|
|
7
|
+
"playlist-modify-public": .playlistModifyPublic,
|
|
8
|
+
"playlist-modify-private": .playlistModifyPrivate,
|
|
9
|
+
"user-follow-read": .userFollowRead,
|
|
10
|
+
"user-follow-modify": .userFollowModify,
|
|
11
|
+
"user-library-read": .userLibraryRead,
|
|
12
|
+
"user-library-modify": .userLibraryModify,
|
|
13
|
+
"user-read-email": .userReadEmail,
|
|
14
|
+
"user-read-private": .userReadPrivate,
|
|
15
|
+
"user-top-read": .userTopRead,
|
|
16
|
+
"ugc-image-upload": .ugcImageUpload,
|
|
17
|
+
"streaming": .streaming,
|
|
18
|
+
"app-remote-control": .appRemoteControl,
|
|
19
|
+
"user-read-playback-state": .userReadPlaybackState,
|
|
20
|
+
"user-modify-playback-state": .userModifyPlaybackState,
|
|
21
|
+
"user-read-currently-playing": .userReadCurrentlyPlaying,
|
|
22
|
+
"user-read-recently-played": .userReadRecentlyPlayed,
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
static func serializeScopes(_ scopes: SPTScope) -> [String] {
|
|
26
|
+
var serializedScopes = [String]()
|
|
27
|
+
for (scopeString, scopeValue) in scopeMap {
|
|
28
|
+
if scopes.contains(scopeValue) {
|
|
29
|
+
serializedScopes.append(scopeString)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return serializedScopes
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static func deserializeScopes(_ scopes: [String]) -> SPTScope {
|
|
36
|
+
var deserializedScopes: SPTScope = []
|
|
37
|
+
for scopeString in scopes {
|
|
38
|
+
if let scopeValue = scopeMap[scopeString] {
|
|
39
|
+
deserializedScopes.insert(scopeValue)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return deserializedScopes
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Gabriel Handford
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,40 @@
|
|
|
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>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>LibraryIdentifier</key>
|
|
9
|
+
<string>ios-arm64</string>
|
|
10
|
+
<key>LibraryPath</key>
|
|
11
|
+
<string>SpotifyiOS.framework</string>
|
|
12
|
+
<key>SupportedArchitectures</key>
|
|
13
|
+
<array>
|
|
14
|
+
<string>arm64</string>
|
|
15
|
+
</array>
|
|
16
|
+
<key>SupportedPlatform</key>
|
|
17
|
+
<string>ios</string>
|
|
18
|
+
</dict>
|
|
19
|
+
<dict>
|
|
20
|
+
<key>LibraryIdentifier</key>
|
|
21
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
22
|
+
<key>LibraryPath</key>
|
|
23
|
+
<string>SpotifyiOS.framework</string>
|
|
24
|
+
<key>SupportedArchitectures</key>
|
|
25
|
+
<array>
|
|
26
|
+
<string>arm64</string>
|
|
27
|
+
<string>x86_64</string>
|
|
28
|
+
</array>
|
|
29
|
+
<key>SupportedPlatform</key>
|
|
30
|
+
<string>ios</string>
|
|
31
|
+
<key>SupportedPlatformVariant</key>
|
|
32
|
+
<string>simulator</string>
|
|
33
|
+
</dict>
|
|
34
|
+
</array>
|
|
35
|
+
<key>CFBundlePackageType</key>
|
|
36
|
+
<string>XFWK</string>
|
|
37
|
+
<key>XCFrameworkFormatVersion</key>
|
|
38
|
+
<string>1.0</string>
|
|
39
|
+
</dict>
|
|
40
|
+
</plist>
|