react-native-acoustic-mobile-push-location-beta 3.9.13 → 3.9.15
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 +2 -2
- package/postinstall.js +24 -4
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"name": "react-native-acoustic-mobile-push-location-beta",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"react-native-acoustic-mobile-push-beta": "3.9.
|
|
27
|
+
"react-native-acoustic-mobile-push-beta": "3.9.15"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"directory": "plugins/react-native-acoustic-mobile-push-location",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
37
37
|
},
|
|
38
38
|
"summary": "react-native ios android mobile push Campaign",
|
|
39
|
-
"version": "3.9.
|
|
39
|
+
"version": "3.9.15"
|
|
40
40
|
}
|
package/postinstall.js
CHANGED
|
@@ -170,9 +170,20 @@ function modifyInfoPlist(mainAppPath) {
|
|
|
170
170
|
function updateiOSConfigFile(projectPath, mainAppPath) {
|
|
171
171
|
const campaignConfigName = 'CampaignConfig.json';
|
|
172
172
|
const appConfigName = 'MceConfig.json';
|
|
173
|
-
|
|
173
|
+
let campaignConfigPath = path.join(projectPath, campaignConfigName);
|
|
174
174
|
const appConfigPath = path.join(mainAppPath, appConfigName);
|
|
175
175
|
|
|
176
|
+
// Handles both plugin install, and manual script execution
|
|
177
|
+
if (!fs.existsSync(campaignConfigPath)) {
|
|
178
|
+
const tempPath = path.join(projectPath, "../../", campaignConfigName);
|
|
179
|
+
if (fs.existsSync(tempPath)) {
|
|
180
|
+
campaignConfigPath = tempPath;
|
|
181
|
+
} else {
|
|
182
|
+
console.error(chalk.red("Could not find CampaignConfig.json. Install required react-native-acoustic-mobile-push plugin."));
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
176
187
|
let configTemplate = {
|
|
177
188
|
"The location autoInitialize flag can be set to false to delay turning on the location services until desired.": "",
|
|
178
189
|
"autoInitialize": true,
|
|
@@ -208,9 +219,20 @@ function updateiOSConfigFile(projectPath, mainAppPath) {
|
|
|
208
219
|
function updateAndroidConfigFile(projectPath, installDirectory) {
|
|
209
220
|
const campaignConfigName = 'CampaignConfig.json';
|
|
210
221
|
const appConfigName = 'MceConfig.json';
|
|
211
|
-
|
|
222
|
+
let campaignConfigPath = path.join(projectPath, campaignConfigName);
|
|
212
223
|
const appConfigPath = path.join(installDirectory, "android", "app", "src", "main", "assets", appConfigName);
|
|
213
224
|
|
|
225
|
+
// Handles both plugin install, and manual script execution
|
|
226
|
+
if (!fs.existsSync(campaignConfigPath)) {
|
|
227
|
+
const tempPath = path.join(projectPath, "../../", campaignConfigName);
|
|
228
|
+
if (fs.existsSync(tempPath)) {
|
|
229
|
+
campaignConfigPath = tempPath;
|
|
230
|
+
} else {
|
|
231
|
+
console.error(chalk.red("Could not find CampaignConfig.json. Install required react-native-acoustic-mobile-push plugin."));
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
214
236
|
let configTemplate = {
|
|
215
237
|
"The location autoInitialize flag can be set to false to delay turning on the location services until desired.": "",
|
|
216
238
|
"autoInitialize": true,
|
|
@@ -271,8 +293,6 @@ modifyManifest(installDirectory);
|
|
|
271
293
|
console.log(chalk.green("Installation Complete!"));
|
|
272
294
|
|
|
273
295
|
console.log(chalk.blue.bold("\nPost Installation Steps\n"));
|
|
274
|
-
console.log(chalk.blue('For react-native 0.59 and lower link the plugin with:'));
|
|
275
|
-
console.log('react-native link react-native-acoustic-mobile-push-location\n');
|
|
276
296
|
|
|
277
297
|
console.log(chalk.blue('iOS Support:'));
|
|
278
298
|
console.log("Please replace the placeholder location usage descriptions in info.plist in the NSLocationWhenInUseUsageDescription, NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription keys.\n");
|