@wwdrew/expo-spotify-sdk 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/android/src/main/java/expo/modules/spotifysdk/ExpoSpotifySDKModule.kt +1 -1
- package/expo-module.config.json +2 -1
- package/ios/ExpoSpotifySDK.podspec +1 -26
- package/ios/ExpoSpotifySDKModule.swift +1 -1
- package/ios/spotify-native-sdk-versions.json +3 -3
- package/package.json +3 -2
- package/plugin/build/ios/withSpotifyIosPod.d.ts +9 -0
- package/plugin/build/ios/withSpotifyIosPod.js +32 -0
- package/plugin/build/withSpotifySdkConfig.js +2 -0
- package/spotify-ios/SpotifyiOS.podspec +37 -0
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ For bare React Native (no Expo CLI), see [Installation in bare React Native](#in
|
|
|
103
103
|
|
|
104
104
|
| Platform | Distribution |
|
|
105
105
|
| --- | --- |
|
|
106
|
-
| **iOS** | `SpotifyiOS`
|
|
106
|
+
| **iOS** | `SpotifyiOS` downloaded via CocoaPods HTTP binary pod at `pod install` ([ADR-0009](./docs/adr/0009-ios-spotify-sdk-via-cocoapods-binary-pod.md)). Config plugin injects the Podfile `pod` line on `expo prebuild`. Supported Expo SDK lanes: [Platform support](#platform-support). |
|
|
107
107
|
| **Android** | App Remote AAR downloaded from Spotify's GitHub at Gradle build. Auth SDK from Maven Central. |
|
|
108
108
|
|
|
109
109
|
| You are… | Action |
|
|
@@ -127,10 +127,11 @@ yarn add @wwdrew/expo-spotify-sdk expo-modules-core
|
|
|
127
127
|
|
|
128
128
|
### 2. iOS
|
|
129
129
|
|
|
130
|
-
Add
|
|
130
|
+
Add pods to your `Podfile`:
|
|
131
131
|
|
|
132
132
|
```ruby
|
|
133
133
|
pod 'ExpoSpotifySDK', :path => '../node_modules/@wwdrew/expo-spotify-sdk'
|
|
134
|
+
pod 'SpotifyiOS', :podspec => File.join(__dir__, '../node_modules/@wwdrew/expo-spotify-sdk/spotify-ios/SpotifyiOS.podspec')
|
|
134
135
|
```
|
|
135
136
|
|
|
136
137
|
Then install pods:
|
|
@@ -8,7 +8,7 @@ import expo.modules.kotlin.functions.Coroutine
|
|
|
8
8
|
import expo.modules.kotlin.modules.Module
|
|
9
9
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
10
10
|
|
|
11
|
-
private const val SDK_VERSION = "2.2.
|
|
11
|
+
private const val SDK_VERSION = "2.2.2" // x-release-please-version
|
|
12
12
|
private const val EVENT_SESSION_CHANGE = "onSessionChange"
|
|
13
13
|
private const val EVENT_CONNECTION_STATE_CHANGE = "onConnectionStateChange"
|
|
14
14
|
private const val EVENT_CONNECTION_ERROR = "onConnectionError"
|
package/expo-module.config.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"platforms": ["ios", "android", "web"],
|
|
3
3
|
"ios": {
|
|
4
4
|
"modules": ["ExpoSpotifySDKModule"],
|
|
5
|
-
"appDelegateSubscribers": ["ExpoSpotifyAppDelegate"]
|
|
5
|
+
"appDelegateSubscribers": ["ExpoSpotifyAppDelegate"],
|
|
6
|
+
"podspecPath": "ios/ExpoSpotifySDK.podspec"
|
|
6
7
|
},
|
|
7
8
|
"android": {
|
|
8
9
|
"modules": ["expo.modules.spotifysdk.ExpoSpotifySDKModule"]
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
|
-
absolute_react_native_path = ''
|
|
4
|
-
if !ENV['REACT_NATIVE_PATH'].nil?
|
|
5
|
-
absolute_react_native_path = File.expand_path(ENV['REACT_NATIVE_PATH'], Pod::Config.instance.project_root)
|
|
6
|
-
else
|
|
7
|
-
absolute_react_native_path = File.dirname(`node --print "require.resolve('react-native/package.json')"`)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
unless defined?(spm_dependency)
|
|
11
|
-
require File.join(absolute_react_native_path, "scripts/react_native_pods")
|
|
12
|
-
end
|
|
13
|
-
|
|
14
3
|
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
15
|
-
spotify_native = JSON.parse(File.read(File.join(__dir__, 'spotify-native-sdk-versions.json')))
|
|
16
4
|
|
|
17
5
|
Pod::Spec.new do |s|
|
|
18
6
|
s.name = 'ExpoSpotifySDK'
|
|
@@ -28,6 +16,7 @@ Pod::Spec.new do |s|
|
|
|
28
16
|
s.static_framework = true
|
|
29
17
|
|
|
30
18
|
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency 'SpotifyiOS'
|
|
31
20
|
|
|
32
21
|
s.pod_target_xcconfig = {
|
|
33
22
|
'DEFINES_MODULE' => 'YES',
|
|
@@ -35,18 +24,4 @@ Pod::Spec.new do |s|
|
|
|
35
24
|
}
|
|
36
25
|
|
|
37
26
|
s.source_files = "**/*.{h,m,swift}"
|
|
38
|
-
|
|
39
|
-
ios_sdk = spotify_native['ios']
|
|
40
|
-
if ios_sdk.nil? ||
|
|
41
|
-
ios_sdk['spmRepositoryUrl'].to_s.empty? ||
|
|
42
|
-
ios_sdk['spmVersion'].to_s.empty? ||
|
|
43
|
-
ios_sdk['spmProduct'].to_s.empty?
|
|
44
|
-
raise "ios/spotify-native-sdk-versions.json is missing required iOS fields: spmRepositoryUrl, spmVersion, spmProduct"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
spm_dependency(s,
|
|
48
|
-
url: ios_sdk['spmRepositoryUrl'],
|
|
49
|
-
requirement: { kind: 'exactVersion', version: ios_sdk['spmVersion'] },
|
|
50
|
-
products: [ios_sdk['spmProduct']]
|
|
51
|
-
)
|
|
52
27
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ExpoModulesCore
|
|
2
2
|
import SpotifyiOS
|
|
3
3
|
|
|
4
|
-
private let SDK_VERSION = "2.2.
|
|
4
|
+
private let SDK_VERSION = "2.2.2" // x-release-please-version
|
|
5
5
|
private let EVENT_SESSION_CHANGE = "onSessionChange"
|
|
6
6
|
private let EVENT_CONNECTION_STATE_CHANGE = "onConnectionStateChange"
|
|
7
7
|
private let EVENT_CONNECTION_ERROR = "onConnectionError"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"ios": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"tarballSha256": "acafc07d35ce3f0bce93cac0031cd1cca1ba7ba6647a3e07e123f2e954ec298b",
|
|
5
|
+
"binarySha256": "988704167a3839136c7a4fd83742fca1422dfad48de41354ed07aa8e47611e32"
|
|
6
6
|
},
|
|
7
7
|
"android": {
|
|
8
8
|
"appRemoteVersion": "0.8.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwdrew/expo-spotify-sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Expo module wrapping the native Spotify iOS (v5) and Android (v4) SDKs for OAuth authentication and App Remote playback control",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"clean": "rm -rf build plugin/build android/build",
|
|
21
21
|
"lint": "eslint src",
|
|
22
22
|
"test": "jest --config jest.config.js",
|
|
23
|
-
"prepublishOnly": "yarn clean && yarn build && yarn build:plugin",
|
|
23
|
+
"prepublishOnly": "yarn clean && yarn build && yarn build:plugin && bash scripts/verify-npm-pack.sh",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
25
|
"open:ios": "open -a \"Xcode\" example/ios",
|
|
26
26
|
"open:android": "open -a \"Android Studio\" example/android"
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"android/src",
|
|
44
44
|
"android/libs/SETUP.md",
|
|
45
45
|
"ios/spotify-native-sdk-versions.json",
|
|
46
|
+
"spotify-ios/SpotifyiOS.podspec",
|
|
46
47
|
"ios/*.swift",
|
|
47
48
|
"ios/*.podspec",
|
|
48
49
|
"app.plugin.js",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConfigPlugin } from "@expo/config-plugins";
|
|
2
|
+
export declare const PODFILE_SPOTIFY_IOS_TAG = "expo-spotify-sdk-spotify-ios-pod";
|
|
3
|
+
/**
|
|
4
|
+
* Standard CocoaPods binary pod — SpotifyiOS.podspec uses `source: { http: ... }`
|
|
5
|
+
* so CocoaPods downloads and runs `prepare_command` (unlike `:path` pods).
|
|
6
|
+
*/
|
|
7
|
+
export declare const PODFILE_SPOTIFY_IOS_POD = " pod 'SpotifyiOS', :podspec => File.join(__dir__, '../node_modules/@wwdrew/expo-spotify-sdk/spotify-ios/SpotifyiOS.podspec')";
|
|
8
|
+
export declare function applySpotifyIosPod(podfileContents: string): string;
|
|
9
|
+
export declare const withSpotifyIosPod: ConfigPlugin;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withSpotifyIosPod = exports.PODFILE_SPOTIFY_IOS_POD = exports.PODFILE_SPOTIFY_IOS_TAG = void 0;
|
|
4
|
+
exports.applySpotifyIosPod = applySpotifyIosPod;
|
|
5
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
7
|
+
exports.PODFILE_SPOTIFY_IOS_TAG = "expo-spotify-sdk-spotify-ios-pod";
|
|
8
|
+
/**
|
|
9
|
+
* Standard CocoaPods binary pod — SpotifyiOS.podspec uses `source: { http: ... }`
|
|
10
|
+
* so CocoaPods downloads and runs `prepare_command` (unlike `:path` pods).
|
|
11
|
+
*/
|
|
12
|
+
exports.PODFILE_SPOTIFY_IOS_POD = ` pod 'SpotifyiOS', :podspec => File.join(__dir__, '../node_modules/@wwdrew/expo-spotify-sdk/spotify-ios/SpotifyiOS.podspec')`;
|
|
13
|
+
function applySpotifyIosPod(podfileContents) {
|
|
14
|
+
const merged = (0, generateCode_1.mergeContents)({
|
|
15
|
+
tag: exports.PODFILE_SPOTIFY_IOS_TAG,
|
|
16
|
+
src: podfileContents,
|
|
17
|
+
newSrc: exports.PODFILE_SPOTIFY_IOS_POD,
|
|
18
|
+
anchor: /use_expo_modules!/,
|
|
19
|
+
offset: 1,
|
|
20
|
+
comment: "#",
|
|
21
|
+
});
|
|
22
|
+
return merged.didMerge || merged.didClear
|
|
23
|
+
? merged.contents
|
|
24
|
+
: podfileContents;
|
|
25
|
+
}
|
|
26
|
+
const withSpotifyIosPod = (config) => {
|
|
27
|
+
return (0, config_plugins_1.withPodfile)(config, (config) => {
|
|
28
|
+
config.modResults.contents = applySpotifyIosPod(config.modResults.contents);
|
|
29
|
+
return config;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.withSpotifyIosPod = withSpotifyIosPod;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withSpotifySdkConfig = void 0;
|
|
4
4
|
const withSpotifyAndroidAppBuildGradle_1 = require("./android/withSpotifyAndroidAppBuildGradle");
|
|
5
5
|
const withSpotifyConfigValues_1 = require("./ios/withSpotifyConfigValues");
|
|
6
|
+
const withSpotifyIosPod_1 = require("./ios/withSpotifyIosPod");
|
|
6
7
|
const withSpotifyQueryScheme_1 = require("./ios/withSpotifyQueryScheme");
|
|
7
8
|
const withSpotifyURLScheme_1 = require("./ios/withSpotifyURLScheme");
|
|
8
9
|
const withSpotifySdkConfig = (config, spotifyConfig) => {
|
|
@@ -18,6 +19,7 @@ const withSpotifySdkConfig = (config, spotifyConfig) => {
|
|
|
18
19
|
// Android specific
|
|
19
20
|
config = (0, withSpotifyAndroidAppBuildGradle_1.withSpotifyAndroidAppBuildGradle)(config, spotifyConfig);
|
|
20
21
|
// iOS specific
|
|
22
|
+
config = (0, withSpotifyIosPod_1.withSpotifyIosPod)(config);
|
|
21
23
|
config = (0, withSpotifyConfigValues_1.withSpotifyConfigValues)(config, spotifyConfig);
|
|
22
24
|
config = (0, withSpotifyQueryScheme_1.withSpotifyQueryScheme)(config, spotifyConfig);
|
|
23
25
|
config = (0, withSpotifyURLScheme_1.withSpotifyURLScheme)(config, spotifyConfig);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
pins = JSON.parse(File.read(File.join(__dir__, '..', 'ios', 'spotify-native-sdk-versions.json')))['ios']
|
|
4
|
+
version = pins['version']
|
|
5
|
+
tag = "v#{version}"
|
|
6
|
+
|
|
7
|
+
Pod::Spec.new do |s|
|
|
8
|
+
s.name = 'SpotifyiOS'
|
|
9
|
+
s.version = version
|
|
10
|
+
s.summary = 'Spotify iOS SDK (binary pod for @wwdrew/expo-spotify-sdk)'
|
|
11
|
+
s.homepage = 'https://github.com/spotify/ios-sdk'
|
|
12
|
+
s.license = { :type => 'Proprietary' }
|
|
13
|
+
s.author = 'Spotify'
|
|
14
|
+
s.platform = :ios, '16.4'
|
|
15
|
+
s.static_framework = true
|
|
16
|
+
|
|
17
|
+
s.source = {
|
|
18
|
+
:http => "https://github.com/spotify/ios-sdk/archive/refs/tags/#{tag}.tar.gz",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
s.prepare_command = <<-CMD
|
|
22
|
+
set -e
|
|
23
|
+
if [ ! -d SpotifyiOS.xcframework ]; then
|
|
24
|
+
framework="$(find . -name 'SpotifyiOS.xcframework' -type d | head -1)"
|
|
25
|
+
test -n "$framework"
|
|
26
|
+
mv "$framework" .
|
|
27
|
+
fi
|
|
28
|
+
if [ ! -d Licenses ]; then
|
|
29
|
+
licenses="$(find . -path '*/Licenses' -type d | head -1)"
|
|
30
|
+
if [ -n "$licenses" ]; then mv "$licenses" .; fi
|
|
31
|
+
fi
|
|
32
|
+
find . -mindepth 1 -maxdepth 1 ! -name 'SpotifyiOS.xcframework' ! -name 'Licenses' -exec rm -rf {} +
|
|
33
|
+
CMD
|
|
34
|
+
|
|
35
|
+
s.vendored_frameworks = 'SpotifyiOS.xcframework'
|
|
36
|
+
s.preserve_paths = 'Licenses'
|
|
37
|
+
end
|