@selligent-marketing-cloud/selligent-react-native 3.7.0 → 3.7.1

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 CHANGED
@@ -25,7 +25,7 @@ This module supports the following SDK and tools:
25
25
  npm install @selligent-marketing-cloud/selligent-react-native --save
26
26
  ```
27
27
 
28
- 2. Create a `selligent.json` file (name is case sensitive) in the root of the React Native project with the following content:
28
+ 2. Create a `selligent.json` file (name is case sensitive) in the root of the React Native project (you can alternatively place it inside another folder or inside a `selligent` folder which will automatically be checked by the wrapper) with the following content:
29
29
 
30
30
  ```json
31
31
  {
@@ -170,7 +170,7 @@ This module supports the following SDK and tools:
170
170
 
171
171
  1. Copy the `node_modules/@selligent-marketing-cloud/selligent-react-native/ios` folder to the **Xcode project**. Drop it under the `Libraries` Folder. This will link the module to the iOS project.
172
172
 
173
- 2. Drag and drop the `selligent.json` you created from the root folder to the Xcode project inside the `Copy Bundle Resources` in `Build phases` of your target:
173
+ 2. Drag and drop the `selligent.json` you created (or the full folder(s) containing it) to the Xcode project inside the `Copy Bundle Resources` in `Build phases` of your target:
174
174
 
175
175
  > Do not check the "copy if needed" option to make sure you only have to manage one selligent.json file
176
176
 
@@ -194,6 +194,8 @@ This module supports the following SDK and tools:
194
194
  // launchOptions = [NSMutableDictionary new];
195
195
  // }
196
196
  // [launchOptions setValue:@"alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
197
+ // [launchOptions setValue:@"selligent/alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
198
+ // [launchOptions setValue:@"alternativeFolder/alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
197
199
 
198
200
  // At the end of application:didFinishLaunchingWithOptions:
199
201
  [RNSelligent configureWithLaunchOptions:launchOptions];
@@ -204,7 +206,7 @@ This module supports the following SDK and tools:
204
206
  <details open>
205
207
  <summary>With autolinking (RN 0.60 and above)</summary>
206
208
 
207
- 1. Drag and drop the `selligent.json` you created from the root folder to the Xcode project inside the `Copy Bundle Resources` in `Build phases` of your target:
209
+ 1. Drag and drop the `selligent.json` you created (or the full folder(s) containing it) to the Xcode project inside the `Copy Bundle Resources` in `Build phases` of your target:
208
210
 
209
211
  > Do not check the "copy if needed" option to make sure you only have to manage one selligent.json file
210
212
 
@@ -222,6 +224,8 @@ This module supports the following SDK and tools:
222
224
  // launchOptions = [NSMutableDictionary new];
223
225
  // }
224
226
  // [launchOptions setValue:@"alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
227
+ // [launchOptions setValue:@"selligent/alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
228
+ // [launchOptions setValue:@"alternativeFolder/alternativeFileName" forKey:@"RN_SELLIGENT_JSON"];
225
229
 
226
230
  // At the end of application:didFinishLaunchingWithOptions:
227
231
  [RNSelligent configureWithLaunchOptions:launchOptions];
@@ -79,9 +79,9 @@ def loadSelligentSettings(variant) {
79
79
  def variantFileName = "selligent.${variant.getName()}.json"
80
80
  def resultingSettings = null
81
81
 
82
- File variantFile = new File("$project.rootDir/../$variantFileName")
83
- File defaultFile = new File("$project.rootDir/../$defaultFileName")
84
- File flavorFile = new File("$project.rootDir/../$currentFlavor/$defaultFileName")
82
+ File variantFile = getFile(variantFileName)
83
+ File defaultFile = getFile(defaultFileName)
84
+ File flavorFile = getFile("$currentFlavor/$defaultFileName")
85
85
 
86
86
  if (variantFile.exists()) {
87
87
  println("Reading Marigold Engage properties for variant ${variant.getName()} from $variantFile.path")
@@ -108,16 +108,31 @@ def loadSelligentSettings(variant) {
108
108
  }
109
109
  }
110
110
  else {
111
- throw new InvalidUserDataException("The selligent.json file could not be found. Please make sure you provide this file in the root of this project.")
111
+ println("WARNING: No selligent.json file could be found for the given task. Disregard this message if the executing task is not building/executing the app.")
112
112
  }
113
113
 
114
114
  return resultingSettings
115
115
  }
116
116
 
117
+ def getFile(filePath) {
118
+ File defaultFile = new File("$project.rootDir/../$filePath")
119
+ File unifiedLocationFile = new File("$project.rootDir/../selligent/$filePath")
120
+
121
+ if (defaultFile.exists()) {
122
+ println("selligent.json found in the root of the project")
123
+ return defaultFile
124
+ }
125
+ else if (unifiedLocationFile.exists()) {
126
+ println("selligent.json found in the unified `selligent` folder")
127
+ }
128
+
129
+ return unifiedLocationFile
130
+ }
131
+
117
132
  def getCurrentFlavor() {
118
133
  Gradle gradle = getGradle()
119
134
  String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
120
- Pattern pattern = Pattern.compile("(install|assemble)(\\w+)(Release|Debug)")
135
+ Pattern pattern = Pattern.compile("(install|assemble|bundle)(\\w+)(Release|Debug)")
121
136
  Matcher matcher = pattern.matcher(tskReqStr)
122
137
 
123
138
  if (matcher.find()) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "name": "@selligent-marketing-cloud/selligent-react-native",
6
6
  "title": "Marigold Engage React Native",
7
- "version": "3.7.0",
7
+ "version": "3.7.1",
8
8
  "description": "React Native wrapper for the Marigold Engage Android and iOS SDKs",
9
9
  "main": "index.js",
10
10
  "repository": {