react-native-acoustic-mobile-push-location-beta 3.10.4 → 3.10.5

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 (2) hide show
  1. package/package.json +2 -2
  2. package/postinstall.js +15 -0
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "author": "Acoustic, L.P.",
11
11
  "peerDependencies": {
12
12
  "react-native": ">=0.76.0",
13
- "react-native-acoustic-mobile-push-beta": "3.10.4"
13
+ "react-native-acoustic-mobile-push-beta": "3.10.5"
14
14
  },
15
15
  "description": "BETA: Acoustic Mobile Push Location Plugin",
16
16
  "main": "index.js",
@@ -19,7 +19,7 @@
19
19
  "directory": "plugins/react-native-acoustic-mobile-push-location",
20
20
  "url": "https://github.com/go-acoustic/Acoustic-Mobile-Push-React-Native"
21
21
  },
22
- "version": "3.10.4",
22
+ "version": "3.10.5",
23
23
  "dependencies": {
24
24
  "plist": "^3.0.1",
25
25
  "xml2js": "^0.4.19",
package/postinstall.js CHANGED
@@ -283,7 +283,22 @@ if(process.env.MCE_RN_NOCONFIG) {
283
283
 
284
284
  console.log(chalk.green.bold("Setting up Acoustic Campaign Location Plugin"));
285
285
  const projectPath = process.cwd();
286
+ // Holds the install lock of react-native-acoustic-mobile-push-beta/install-lock.js (a peer dependency of this plugin),
287
+ // so the plugins' postinstall scripts configure the app one at a time. Without it (an older push plugin, or a package
288
+ // manager that skips peer dependencies) this script configures the app without waiting for the others.
289
+ function holdInstallLock(installDirectory) {
290
+ try {
291
+ require('react-native-acoustic-mobile-push-beta/install-lock').holdInstallLock(installDirectory);
292
+ } catch (error) {
293
+ if (error.code !== 'MODULE_NOT_FOUND') {
294
+ throw error;
295
+ }
296
+ console.log(chalk.yellow("react-native-acoustic-mobile-push-beta/install-lock not found; configuring without the install lock."));
297
+ }
298
+ }
299
+
286
300
  const installDirectory = findInstallDirectory();
301
+ holdInstallLock(installDirectory);
287
302
  const mainAppPath = findMainPath(installDirectory);
288
303
  modifyInfoPlist(mainAppPath);
289
304
  updateiOSConfigFile(projectPath, mainAppPath);