@wwdrew/expo-apple-music 1.1.1 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwdrew/expo-apple-music",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Apple MusicKit wrapper for Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "test": "jest --watchman=false",
12
12
  "test:expo": "expo-module test",
13
13
  "prepare": "expo-module prepare",
14
- "prepublishOnly": "node scripts/npm-prepublish.mjs && expo-module prepublishOnly && expo-module build plugin",
14
+ "prepublishOnly": "npm run build && node scripts/npm-prepublish.mjs && expo-module prepublishOnly",
15
15
  "pack:check": "npm run build && node scripts/verify-npm-pack.mjs",
16
16
  "expo-module": "expo-module",
17
17
  "dev-token": "node scripts/generate-developer-token.mjs",
@@ -76,12 +76,12 @@
76
76
  "./plugin": {
77
77
  "types": "./plugin/build/index.d.ts",
78
78
  "default": "./plugin/build/index.js"
79
- }
79
+ },
80
+ "./app.plugin.js": "./app.plugin.js",
81
+ "./package.json": "./package.json"
80
82
  },
81
83
  "peerDependencies": {
82
- "@expo/config-plugins": ">=9.0.0",
83
- "expo": "^56.0.0",
84
- "expo-modules-core": "*",
84
+ "expo": "*",
85
85
  "react": "*",
86
86
  "react-native": "*"
87
87
  }
@@ -38,6 +38,32 @@ const withIosDeploymentTargetXcodeProject = (config) => {
38
38
  });
39
39
  };
40
40
  exports.DEFAULT_MUSIC_USAGE = "Allow $(PRODUCT_NAME) to access Apple Music.";
41
+ const ALLOW_BACKUP_REPLACE_KEY = "android:allowBackup";
42
+ /** musickitauth AAR sets allowBackup=true; host apps may differ — merge via tools:replace. */
43
+ const withAndroidAllowBackupToolsReplace = (config) => {
44
+ return (0, config_plugins_1.withAndroidManifest)(config, (c) => {
45
+ const mainApplication = c.modResults?.manifest?.application?.[0];
46
+ if (!mainApplication?.$) {
47
+ return c;
48
+ }
49
+ const existing = mainApplication.$["tools:replace"];
50
+ if (!existing) {
51
+ mainApplication.$["tools:replace"] = ALLOW_BACKUP_REPLACE_KEY;
52
+ return c;
53
+ }
54
+ const keys = [
55
+ ...new Set(existing
56
+ .split(",")
57
+ .map((key) => key.trim())
58
+ .filter(Boolean)),
59
+ ];
60
+ if (!keys.includes(ALLOW_BACKUP_REPLACE_KEY)) {
61
+ keys.push(ALLOW_BACKUP_REPLACE_KEY);
62
+ }
63
+ mainApplication.$["tools:replace"] = keys.join(",");
64
+ return c;
65
+ });
66
+ };
41
67
  const withAndroidMusicKitAars = (config, { androidMusicKitAarDir } = {}) => {
42
68
  return (0, config_plugins_1.withDangerousMod)(config, [
43
69
  "android",
@@ -62,6 +88,7 @@ const withExpoAppleMusic = (config, props) => {
62
88
  config = withIosDeploymentTargetPodfile(config);
63
89
  config = withIosDeploymentTargetXcodeProject(config);
64
90
  config = withAndroidMusicKitAars(config, { androidMusicKitAarDir });
91
+ config = withAndroidAllowBackupToolsReplace(config);
65
92
  return (0, config_plugins_1.withInfoPlist)(config, (c) => {
66
93
  const current = c.modResults.NSAppleMusicUsageDescription;
67
94
  const hasCurrent = typeof current === "string" && current.trim().length > 0;