@convivainc/conviva-react-native-appanalytics 0.1.0 → 0.1.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/CHANGELOG.md +8 -0
- package/README.md +5 -10
- package/RNConvivaAppAnalytics.podspec +24 -0
- package/android/build.gradle +55 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradle.properties +2 -0
- package/android/gradlew +172 -0
- package/android/gradlew.bat +84 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/conviva/react/apptracker/RNConvivaTrackerModule.java +804 -0
- package/android/src/main/java/com/conviva/react/apptracker/RNConvivaTrackerPackage.java +29 -0
- package/android/src/main/java/com/conviva/react/apptracker/util/ConfigUtil.java +346 -0
- package/android/src/main/java/com/conviva/react/apptracker/util/EventUtil.java +339 -0
- package/android/src/main/java/com/conviva/react/apptracker/util/TrackerVersion.java +9 -0
- package/ios/RNConvivaAppAnalytics.h +34 -0
- package/ios/RNConvivaAppAnalytics.m +1051 -0
- package/ios/RNConvivaAppAnalytics.xcodeproj/project.pbxproj +325 -0
- package/ios/RNConvivaAppAnalytics.xcodeproj/xcshareddata/xcschemes/RNSnowplowTracker.xcscheme +76 -0
- package/ios/Util/NSDictionary+RNCAT_TypeMethods.h +33 -0
- package/ios/Util/NSDictionary+RNCAT_TypeMethods.m +40 -0
- package/ios/Util/RNConfigUtils.h +46 -0
- package/ios/Util/RNConfigUtils.m +217 -0
- package/ios/Util/RNTrackerVersion.h +27 -0
- package/ios/Util/RNTrackerVersion.m +27 -0
- package/ios/Util/RNUtilities.h +32 -0
- package/ios/Util/RNUtilities.m +68 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
package com.conviva.react.apptracker;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage;
|
|
4
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
5
|
+
import com.facebook.react.bridge.NativeModule;
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
8
|
+
|
|
9
|
+
import java.util.Arrays;
|
|
10
|
+
import java.util.Collections;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
|
|
13
|
+
public class RNConvivaTrackerPackage implements ReactPackage {
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
17
|
+
return Arrays.<NativeModule>asList(new RNConvivaTrackerModule(reactContext));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Deprecated from RN 0.47
|
|
21
|
+
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
22
|
+
return Collections.emptyList();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@Override
|
|
26
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
27
|
+
return Collections.emptyList();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
package com.conviva.react.apptracker.util;
|
|
2
|
+
|
|
3
|
+
import com.conviva.apptracker.configuration.EmitterConfiguration;
|
|
4
|
+
import com.conviva.apptracker.configuration.GdprConfiguration;
|
|
5
|
+
import com.conviva.apptracker.configuration.GlobalContextsConfiguration;
|
|
6
|
+
import com.conviva.apptracker.configuration.SessionConfiguration;
|
|
7
|
+
import com.conviva.apptracker.configuration.SubjectConfiguration;
|
|
8
|
+
import com.conviva.apptracker.configuration.TrackerConfiguration;
|
|
9
|
+
import com.conviva.apptracker.emitter.BufferOption;
|
|
10
|
+
import com.conviva.apptracker.globalcontexts.GlobalContext;
|
|
11
|
+
import com.conviva.apptracker.payload.SelfDescribingJson;
|
|
12
|
+
import com.conviva.apptracker.tracker.DevicePlatform;
|
|
13
|
+
import com.conviva.apptracker.tracker.LogLevel;
|
|
14
|
+
import com.conviva.apptracker.util.Basis;
|
|
15
|
+
import com.conviva.apptracker.util.Size;
|
|
16
|
+
import com.conviva.apptracker.util.TimeMeasure;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
19
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
20
|
+
|
|
21
|
+
import java.util.ArrayList;
|
|
22
|
+
import java.util.HashMap;
|
|
23
|
+
import java.util.List;
|
|
24
|
+
import java.util.concurrent.TimeUnit;
|
|
25
|
+
|
|
26
|
+
public class ConfigUtil {
|
|
27
|
+
|
|
28
|
+
public static DevicePlatform mkDevicePlatform(String devPlatform) {
|
|
29
|
+
|
|
30
|
+
DevicePlatform devicePlatform = DevicePlatform.Mobile;
|
|
31
|
+
if (devPlatform.equals("web")) {
|
|
32
|
+
devicePlatform = DevicePlatform.Web;
|
|
33
|
+
} else if (devPlatform.equals("srv")) {
|
|
34
|
+
devicePlatform = DevicePlatform.ServerSideApp;
|
|
35
|
+
} else if (devPlatform.equals("pc")) {
|
|
36
|
+
devicePlatform = DevicePlatform.Desktop;
|
|
37
|
+
} else if (devPlatform.equals("app")) {
|
|
38
|
+
devicePlatform = DevicePlatform.General;
|
|
39
|
+
} else if (devPlatform.equals("tv")) {
|
|
40
|
+
devicePlatform = DevicePlatform.ConnectedTV;
|
|
41
|
+
} else if (devPlatform.equals("cnsl")) {
|
|
42
|
+
devicePlatform = DevicePlatform.GameConsole;
|
|
43
|
+
} else if (devPlatform.equals("iot")) {
|
|
44
|
+
devicePlatform = DevicePlatform.InternetOfThings;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return devicePlatform;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static LogLevel mkLogLevel(String logLvl) {
|
|
51
|
+
|
|
52
|
+
LogLevel logLevel = LogLevel.OFF;
|
|
53
|
+
if (logLvl.equals("error")) {
|
|
54
|
+
logLevel = LogLevel.ERROR;
|
|
55
|
+
} else if (logLvl.equals("debug")) {
|
|
56
|
+
logLevel = LogLevel.DEBUG;
|
|
57
|
+
} else if (logLvl.equals("verbose")) {
|
|
58
|
+
logLevel = LogLevel.VERBOSE;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return logLevel;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public static BufferOption mkBufferOption(String bufferOpt) {
|
|
65
|
+
|
|
66
|
+
BufferOption bufferOption = BufferOption.Single;
|
|
67
|
+
if (bufferOpt.equals("default")) {
|
|
68
|
+
bufferOption = BufferOption.DefaultGroup;
|
|
69
|
+
} else if (bufferOpt.equals("heavy")) {
|
|
70
|
+
bufferOption = BufferOption.HeavyGroup;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return bufferOption;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static Basis mkBasis(String basis) {
|
|
77
|
+
|
|
78
|
+
Basis basisForProcessing = Basis.CONSENT;
|
|
79
|
+
if (basis.equals("contract")) {
|
|
80
|
+
basisForProcessing = Basis.CONTRACT;
|
|
81
|
+
}
|
|
82
|
+
if (basis.equals("legal_obligation")) {
|
|
83
|
+
basisForProcessing = Basis.LEGAL_OBLIGATION;
|
|
84
|
+
}
|
|
85
|
+
if (basis.equals("legitimate_interests")) {
|
|
86
|
+
basisForProcessing = Basis.LEGITIMATE_INTERESTS;
|
|
87
|
+
}
|
|
88
|
+
if (basis.equals("public_task")) {
|
|
89
|
+
basisForProcessing = Basis.PUBLIC_TASK;
|
|
90
|
+
}
|
|
91
|
+
if (basis.equals("vital_interests")) {
|
|
92
|
+
basisForProcessing = Basis.VITAL_INTERESTS;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return basisForProcessing;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public static TrackerConfiguration mkTrackerConfiguration(ReadableMap trackerConfig, String appName,
|
|
99
|
+
ReactApplicationContext context) {
|
|
100
|
+
TrackerConfiguration trackerConfiguration = new TrackerConfiguration(appName)
|
|
101
|
+
.trackerVersionSuffix(TrackerVersion.RN_CONVIVA_TRACKER_VERSION);
|
|
102
|
+
|
|
103
|
+
if (trackerConfig != null) {
|
|
104
|
+
if (trackerConfig.hasKey("devicePlatform")) {
|
|
105
|
+
DevicePlatform devicePlatform = mkDevicePlatform(trackerConfig.getString("devicePlatform"));
|
|
106
|
+
trackerConfiguration.devicePlatform(devicePlatform);
|
|
107
|
+
}
|
|
108
|
+
if (trackerConfig.hasKey("logLevel")) {
|
|
109
|
+
LogLevel logLevel = mkLogLevel(trackerConfig.getString("logLevel"));
|
|
110
|
+
trackerConfiguration.logLevel(logLevel);
|
|
111
|
+
}
|
|
112
|
+
if (trackerConfig.hasKey("base64Encoding")) {
|
|
113
|
+
trackerConfiguration.base64encoding(trackerConfig.getBoolean("base64Encoding"));
|
|
114
|
+
}
|
|
115
|
+
if (trackerConfig.hasKey("applicationContext")) {
|
|
116
|
+
trackerConfiguration.applicationContext(trackerConfig.getBoolean("applicationContext"));
|
|
117
|
+
}
|
|
118
|
+
if (trackerConfig.hasKey("platformContext")) {
|
|
119
|
+
trackerConfiguration.platformContext(trackerConfig.getBoolean("platformContext"));
|
|
120
|
+
}
|
|
121
|
+
if (trackerConfig.hasKey("geoLocationContext")) {
|
|
122
|
+
trackerConfiguration.geoLocationContext(trackerConfig.getBoolean("geoLocationContext"));
|
|
123
|
+
}
|
|
124
|
+
if (trackerConfig.hasKey("sessionContext")) {
|
|
125
|
+
trackerConfiguration.sessionContext(trackerConfig.getBoolean("sessionContext"));
|
|
126
|
+
}
|
|
127
|
+
if (trackerConfig.hasKey("screenContext")) {
|
|
128
|
+
trackerConfiguration.screenContext(trackerConfig.getBoolean("screenContext"));
|
|
129
|
+
}
|
|
130
|
+
if (trackerConfig.hasKey("screenViewAutotracking")) {
|
|
131
|
+
trackerConfiguration.screenViewAutotracking(trackerConfig.getBoolean("screenViewAutotracking"));
|
|
132
|
+
}
|
|
133
|
+
if (trackerConfig.hasKey("lifecycleAutotracking")) {
|
|
134
|
+
trackerConfiguration.lifecycleAutotracking(trackerConfig.getBoolean("lifecycleAutotracking"));
|
|
135
|
+
}
|
|
136
|
+
if (trackerConfig.hasKey("installAutotracking")) {
|
|
137
|
+
trackerConfiguration.installAutotracking(trackerConfig.getBoolean("installAutotracking"));
|
|
138
|
+
}
|
|
139
|
+
if (trackerConfig.hasKey("exceptionAutotracking")) {
|
|
140
|
+
trackerConfiguration.exceptionAutotracking(trackerConfig.getBoolean("exceptionAutotracking"));
|
|
141
|
+
}
|
|
142
|
+
if (trackerConfig.hasKey("diagnosticAutotracking")) {
|
|
143
|
+
trackerConfiguration.diagnosticAutotracking(trackerConfig.getBoolean("diagnosticAutotracking"));
|
|
144
|
+
}
|
|
145
|
+
if (trackerConfig.hasKey("deepLinkContext")) {
|
|
146
|
+
trackerConfiguration.deepLinkContext(trackerConfig.getBoolean("deepLinkContext"));
|
|
147
|
+
}
|
|
148
|
+
if (trackerConfig.hasKey("userAnonymisation")) {
|
|
149
|
+
trackerConfiguration.userAnonymisation(trackerConfig.getBoolean("userAnonymisation"));
|
|
150
|
+
}
|
|
151
|
+
if (trackerConfig.hasKey("bundleInfoAutotracking")) {
|
|
152
|
+
trackerConfiguration.bundleInfoAutotracking(trackerConfig.getBoolean("bundleInfoAutotracking"));
|
|
153
|
+
}
|
|
154
|
+
if (trackerConfig.hasKey("enablePeriodicHeartbeat")) {
|
|
155
|
+
trackerConfiguration.enablePeriodicHeartbeat(trackerConfig.getBoolean("enablePeriodicHeartbeat"));
|
|
156
|
+
}
|
|
157
|
+
if (trackerConfig.hasKey("periodicHeartbeatIntervalInSec")) {
|
|
158
|
+
trackerConfiguration.periodicHeartbeatIntervalInSec(trackerConfig.getInt("periodicHeartbeatIntervalInSec"));
|
|
159
|
+
}
|
|
160
|
+
if (trackerConfig.hasKey("periodicHeartbeatDelayInSec")) {
|
|
161
|
+
trackerConfiguration.periodicHeartbeatDelayInSec(trackerConfig.getInt("periodicHeartbeatDelayInSec"));
|
|
162
|
+
}
|
|
163
|
+
if (trackerConfig.hasKey("userClickAutotracking")) {
|
|
164
|
+
trackerConfiguration.userClickAutotracking(trackerConfig.getBoolean("userClickAutotracking"));
|
|
165
|
+
}
|
|
166
|
+
if (trackerConfig.hasKey("deepLinkAutotracking")) {
|
|
167
|
+
trackerConfiguration.deepLinkAutotracking(trackerConfig.getBoolean("deepLinkAutotracking"));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return trackerConfiguration;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public static SessionConfiguration mkSessionConfiguration(ReadableMap sessionConfig) {
|
|
175
|
+
long foregroundTimeout = (long) sessionConfig.getDouble("foregroundTimeout");
|
|
176
|
+
|
|
177
|
+
long backgroundTimeout = (long) sessionConfig.getDouble("backgroundTimeout");
|
|
178
|
+
|
|
179
|
+
SessionConfiguration sessionConfiguration = new SessionConfiguration(
|
|
180
|
+
new TimeMeasure(foregroundTimeout, TimeUnit.SECONDS),
|
|
181
|
+
new TimeMeasure(backgroundTimeout, TimeUnit.SECONDS));
|
|
182
|
+
|
|
183
|
+
return sessionConfiguration;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public static EmitterConfiguration mkEmitterConfiguration(ReadableMap emitterConfig) {
|
|
187
|
+
EmitterConfiguration emitterConfiguration = new EmitterConfiguration();
|
|
188
|
+
|
|
189
|
+
if (emitterConfig.hasKey("bufferOption")) {
|
|
190
|
+
BufferOption bufferOption = mkBufferOption(emitterConfig.getString("bufferOption"));
|
|
191
|
+
emitterConfiguration.bufferOption(bufferOption);
|
|
192
|
+
}
|
|
193
|
+
if (emitterConfig.hasKey("emitRange")) {
|
|
194
|
+
int emitRange = (int) emitterConfig.getDouble("emitRange");
|
|
195
|
+
emitterConfiguration.emitRange(emitRange);
|
|
196
|
+
}
|
|
197
|
+
if (emitterConfig.hasKey("threadPoolSize")) {
|
|
198
|
+
int threadPoolSize = (int) emitterConfig.getDouble("threadPoolSize");
|
|
199
|
+
emitterConfiguration.threadPoolSize(threadPoolSize);
|
|
200
|
+
}
|
|
201
|
+
if (emitterConfig.hasKey("byteLimitPost")) {
|
|
202
|
+
int byteLimitPost = (int) emitterConfig.getDouble("byteLimitPost");
|
|
203
|
+
emitterConfiguration.byteLimitPost(byteLimitPost);
|
|
204
|
+
}
|
|
205
|
+
if (emitterConfig.hasKey("byteLimitGet")) {
|
|
206
|
+
int byteLimitGet = (int) emitterConfig.getDouble("byteLimitGet");
|
|
207
|
+
emitterConfiguration.byteLimitGet(byteLimitGet);
|
|
208
|
+
}
|
|
209
|
+
if (emitterConfig.hasKey("serverAnonymisation")) {
|
|
210
|
+
emitterConfiguration.serverAnonymisation(emitterConfig.getBoolean("serverAnonymisation"));
|
|
211
|
+
}
|
|
212
|
+
if (emitterConfig.hasKey("disableEventCaching")) {
|
|
213
|
+
emitterConfiguration.disableEventCaching(emitterConfig.getBoolean("disableEventCaching"));
|
|
214
|
+
}
|
|
215
|
+
return emitterConfiguration;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public static SubjectConfiguration mkSubjectConfiguration(ReadableMap subjectConfig) {
|
|
219
|
+
SubjectConfiguration subjectConfiguration = new SubjectConfiguration();
|
|
220
|
+
|
|
221
|
+
if (subjectConfig.hasKey("userId")) {
|
|
222
|
+
if (subjectConfig.isNull("userId")) {
|
|
223
|
+
subjectConfiguration.userId(null);
|
|
224
|
+
} else {
|
|
225
|
+
subjectConfiguration.userId(subjectConfig.getString("userId"));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
if (subjectConfig.hasKey("networkUserId")) {
|
|
229
|
+
if (subjectConfig.isNull("networkUserId")) {
|
|
230
|
+
subjectConfiguration.networkUserId(null);
|
|
231
|
+
} else {
|
|
232
|
+
subjectConfiguration.networkUserId(subjectConfig.getString("networkUserId"));
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (subjectConfig.hasKey("domainUserId")) {
|
|
236
|
+
if (subjectConfig.isNull("domainUserId")) {
|
|
237
|
+
subjectConfiguration.domainUserId(null);
|
|
238
|
+
} else {
|
|
239
|
+
subjectConfiguration.domainUserId(subjectConfig.getString("domainUserId"));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (subjectConfig.hasKey("useragent")) {
|
|
243
|
+
if (subjectConfig.isNull("useragent")) {
|
|
244
|
+
subjectConfiguration.useragent(null);
|
|
245
|
+
} else {
|
|
246
|
+
subjectConfiguration.useragent(subjectConfig.getString("useragent"));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (subjectConfig.hasKey("ipAddress")) {
|
|
250
|
+
if (subjectConfig.isNull("ipAddress")) {
|
|
251
|
+
subjectConfiguration.ipAddress(null);
|
|
252
|
+
} else {
|
|
253
|
+
subjectConfiguration.ipAddress(subjectConfig.getString("ipAddress"));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (subjectConfig.hasKey("timezone")) {
|
|
257
|
+
if (subjectConfig.isNull("timezone")) {
|
|
258
|
+
subjectConfiguration.timezone(null);
|
|
259
|
+
} else {
|
|
260
|
+
subjectConfiguration.timezone(subjectConfig.getString("timezone"));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (subjectConfig.hasKey("language")) {
|
|
264
|
+
if (subjectConfig.isNull("language")) {
|
|
265
|
+
subjectConfiguration.language(null);
|
|
266
|
+
} else {
|
|
267
|
+
subjectConfiguration.language(subjectConfig.getString("language"));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (subjectConfig.hasKey("screenResolution")) {
|
|
271
|
+
if (subjectConfig.isNull("screenResolution")) {
|
|
272
|
+
subjectConfiguration.screenResolution(null);
|
|
273
|
+
} else {
|
|
274
|
+
ReadableArray screenRes = subjectConfig.getArray("screenResolution");
|
|
275
|
+
int screenWidth = (int) screenRes.getDouble(0);
|
|
276
|
+
int screenHeight = (int) screenRes.getDouble(1);
|
|
277
|
+
|
|
278
|
+
Size screenResolution = new Size(screenWidth, screenHeight);
|
|
279
|
+
subjectConfiguration.screenResolution(screenResolution);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (subjectConfig.hasKey("screenViewport")) {
|
|
283
|
+
if (subjectConfig.isNull("screenViewport")) {
|
|
284
|
+
subjectConfiguration.screenViewPort(null);
|
|
285
|
+
} else {
|
|
286
|
+
ReadableArray screenVP = subjectConfig.getArray("screenViewport");
|
|
287
|
+
int screenVPWidth = (int) screenVP.getDouble(0);
|
|
288
|
+
int screenVPHeight = (int) screenVP.getDouble(1);
|
|
289
|
+
|
|
290
|
+
Size screenViewport = new Size(screenVPWidth, screenVPHeight);
|
|
291
|
+
subjectConfiguration.screenViewPort(screenViewport);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (subjectConfig.hasKey("colorDepth")) {
|
|
295
|
+
if (subjectConfig.isNull("colorDepth")) {
|
|
296
|
+
subjectConfiguration.colorDepth(null);
|
|
297
|
+
} else {
|
|
298
|
+
int colorDepth = (int) subjectConfig.getDouble("colorDepth");
|
|
299
|
+
subjectConfiguration.colorDepth(colorDepth);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return subjectConfiguration;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
public static GdprConfiguration mkGdprConfiguration(ReadableMap gdprConfig) {
|
|
307
|
+
Basis basis = mkBasis(gdprConfig.getString("basisForProcessing"));
|
|
308
|
+
String docId = gdprConfig.getString("documentId");
|
|
309
|
+
String docVer = gdprConfig.getString("documentVersion");
|
|
310
|
+
String docDesc = gdprConfig.getString("documentDescription");
|
|
311
|
+
|
|
312
|
+
GdprConfiguration gdprConfiguration = new GdprConfiguration(basis,
|
|
313
|
+
docId,
|
|
314
|
+
docVer,
|
|
315
|
+
docDesc);
|
|
316
|
+
|
|
317
|
+
return gdprConfiguration;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
public static GlobalContextsConfiguration mkGCConfiguration(ReadableArray gcConfig) {
|
|
321
|
+
|
|
322
|
+
HashMap contextGens = new HashMap<>();
|
|
323
|
+
for (int i = 0; i < gcConfig.size(); i++) {
|
|
324
|
+
ReadableMap gcMap = gcConfig.getMap(i);
|
|
325
|
+
|
|
326
|
+
String itag = gcMap.getString("tag");
|
|
327
|
+
ReadableArray globalContexts = gcMap.getArray("globalContexts");
|
|
328
|
+
|
|
329
|
+
List<SelfDescribingJson> staticContexts = new ArrayList<>();
|
|
330
|
+
for (int x = 0; x < globalContexts.size(); x++) {
|
|
331
|
+
SelfDescribingJson gContext = EventUtil.createSelfDescribingJson(globalContexts.getMap(x));
|
|
332
|
+
staticContexts.add(gContext);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
GlobalContext gcStatic = new GlobalContext(staticContexts);
|
|
336
|
+
|
|
337
|
+
if (!contextGens.containsKey(itag)) {
|
|
338
|
+
contextGens.put(itag, gcStatic);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
GlobalContextsConfiguration gcConfiguration = new GlobalContextsConfiguration(contextGens);
|
|
343
|
+
|
|
344
|
+
return gcConfiguration;
|
|
345
|
+
}
|
|
346
|
+
}
|