@snowplow/react-native-tracker 1.0.0-beta.1 → 1.2.0

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 CHANGED
@@ -1,3 +1,20 @@
1
+ Version 1.2.0 (2022-03-25)
2
+ --------------------------
3
+ Add support for React Native for tvOS (#154)
4
+ Bump min RN version supported to v0.65+ (#153)
5
+ Add generic type for SelfDescribing event data (#156)
6
+
7
+ Version 1.1.0 (2022-02-07)
8
+ --------------------------
9
+ Update mobile tracker dependencies to v3 (#141)
10
+ Add deep link and message notification events (#142)
11
+ Update demo app to show accessing tracker instance from platform native code (#136)
12
+ Fix compilation error for iOS build on ARM macs (#140)
13
+ Fix check for byteLimitGet when reading emitter configuration (#138)
14
+ Fix check for Android version in GitHub Actions (#134)
15
+ Update year in all copyright notices (#148)
16
+ Update dependencies (#150)
17
+
1
18
  Version 1.0.0 (2021-08-09)
2
19
  --------------------------
3
20
  Fix action-gh-release to specific commit (#133)
package/LICENSE CHANGED
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright (c) 2020-2021 Snowplow Analytics Ltd, 2019 DataCamp.
190
+ Copyright (c) 2020-2022 Snowplow Analytics Ltd, 2019 DataCamp.
191
191
  All rights reserved.
192
192
 
193
193
  Licensed under the Apache License, Version 2.0 (the "License");
package/README.md CHANGED
@@ -70,6 +70,8 @@ npm run bootstrap
70
70
  cd DemoApp
71
71
  ```
72
72
 
73
+ Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoApp/App.js`.
74
+
73
75
  **For Android:**
74
76
 
75
77
  ```bash
@@ -105,6 +107,34 @@ bash .scripts/cleanBuildAndRun.sh ios
105
107
  bash .scripts/cleanBuildAndRun.sh both
106
108
  ```
107
109
 
110
+ ### Launching the Demo App for Apple TV and Android TV
111
+
112
+ Assuming a [react-native environment][react-native-environment] is set up, from the root of the repository:
113
+
114
+ ```bash
115
+ npm install
116
+ npm run bootstrap
117
+ cd DemoAppTV
118
+ yarn
119
+ ```
120
+
121
+ Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoAppTV/App.js`.
122
+
123
+ **For Android TV:**
124
+
125
+ ```bash
126
+ yarn android
127
+ ```
128
+
129
+ _Note_: Linux users who want to run the DemoApp for Android, would also need to run `yarn start` in a separate terminal.
130
+
131
+ **For tvOS:**
132
+
133
+ ```bash
134
+ yarn pods && yarn tvos
135
+ ```
136
+
137
+ Note: If you are using simulator with a name different than "Apple TV", you will need to update the `--simulator` parameter in the "tvos" script call in `DemoAppTV/package.json`.
108
138
 
109
139
  ### End-to-end tests
110
140
 
@@ -169,7 +199,7 @@ Feedback and contributions are welcome - if you have identified a bug, please lo
169
199
 
170
200
  ## Copyright and license
171
201
 
172
- The Snowplow React Native Tracker is copyright 2020-2021 Snowplow Analytics Ltd, 2019 DataCamp.
202
+ The Snowplow React Native Tracker is copyright 2020-2022 Snowplow Analytics Ltd, 2019 DataCamp.
173
203
 
174
204
  Licensed under the **[Apache License, Version 2.0][license]** (the "License");
175
205
  you may not use this software except in compliance with the License.
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.homepage = package['homepage']
13
13
  s.author = { "Snowplow Analytics Ltd" => "info@snowplowanalytics.com" }
14
14
 
15
- s.platforms = { :ios => "9.0" }
15
+ s.platforms = { :ios => "9.0", :tvos => "9.0" }
16
16
 
17
17
  s.source = { :git => "https://github.com/snowplow-incubator/snowplow-react-native-tracker.git", :tag => "#{s.version}" }
18
18
  s.source_files = "ios/**/*.{h,m}"
@@ -20,5 +20,5 @@ Pod::Spec.new do |s|
20
20
  s.requires_arc = true
21
21
 
22
22
  s.dependency "React-Core"
23
- s.dependency "SnowplowTracker", "~> 2.2"
23
+ s.dependency "SnowplowTracker", "~> 3.0"
24
24
  end
@@ -48,7 +48,7 @@ dependencies {
48
48
  implementation 'androidx.lifecycle:lifecycle-extensions:2.2.+'
49
49
 
50
50
  // Required Dependency for the Tracker
51
- implementation "com.squareup.okhttp3:okhttp:4.9.1"
51
+ implementation "com.squareup.okhttp3:okhttp:4.9.3"
52
52
  implementation "com.facebook.react:react-native:+"
53
- implementation 'com.snowplowanalytics:snowplow-android-tracker:2.+@aar'
53
+ implementation 'com.snowplowanalytics:snowplow-android-tracker:3.+'
54
54
  }
@@ -18,6 +18,8 @@ import com.snowplowanalytics.snowplow.configuration.SessionConfiguration;
18
18
  import com.snowplowanalytics.snowplow.configuration.TrackerConfiguration;
19
19
  import com.snowplowanalytics.snowplow.configuration.SubjectConfiguration;
20
20
  import com.snowplowanalytics.snowplow.configuration.GlobalContextsConfiguration;
21
+ import com.snowplowanalytics.snowplow.event.DeepLinkReceived;
22
+ import com.snowplowanalytics.snowplow.event.MessageNotification;
21
23
  import com.snowplowanalytics.snowplow.globalcontexts.GlobalContext;
22
24
  import com.snowplowanalytics.snowplow.controller.TrackerController;
23
25
  import com.snowplowanalytics.snowplow.payload.SelfDescribingJson;
@@ -166,7 +168,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
166
168
  TrackerController trackerController = Snowplow.getTracker(namespace);
167
169
 
168
170
  SelfDescribingJson sdj = EventUtil.createSelfDescribingJson(argmap);
169
- SelfDescribing event = SelfDescribing.builder().eventData(sdj).build();
171
+ SelfDescribing event = new SelfDescribing(sdj);
170
172
 
171
173
  List<SelfDescribingJson> evCtxts = EventUtil.createContexts(contexts);
172
174
  event.customContexts.addAll(evCtxts);
@@ -340,6 +342,52 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
340
342
  }
341
343
  }
342
344
 
345
+ @ReactMethod
346
+ public void trackDeepLinkReceivedEvent(ReadableMap details,
347
+ Promise promise) {
348
+ try {
349
+ String namespace = details.getString("tracker");
350
+ ReadableMap argmap = details.getMap("eventData");
351
+ ReadableArray contexts = details.getArray("contexts");
352
+
353
+ TrackerController trackerController = Snowplow.getTracker(namespace);
354
+
355
+ DeepLinkReceived event = EventUtil.createDeepLinkReceivedEvent(argmap);
356
+
357
+ List<SelfDescribingJson> evCtxts = EventUtil.createContexts(contexts);
358
+ event.customContexts.addAll(evCtxts);
359
+
360
+ trackerController.track(event);
361
+ promise.resolve(true);
362
+
363
+ } catch(Throwable t) {
364
+ promise.reject("ERROR", t.getMessage());
365
+ }
366
+ }
367
+
368
+ @ReactMethod
369
+ public void trackMessageNotificationEvent(ReadableMap details,
370
+ Promise promise) {
371
+ try {
372
+ String namespace = details.getString("tracker");
373
+ ReadableMap argmap = details.getMap("eventData");
374
+ ReadableArray contexts = details.getArray("contexts");
375
+
376
+ TrackerController trackerController = Snowplow.getTracker(namespace);
377
+
378
+ MessageNotification event = EventUtil.createMessageNotificationEvent(argmap);
379
+
380
+ List<SelfDescribingJson> evCtxts = EventUtil.createContexts(contexts);
381
+ event.customContexts.addAll(evCtxts);
382
+
383
+ trackerController.track(event);
384
+ promise.resolve(true);
385
+
386
+ } catch(Throwable t) {
387
+ promise.reject("ERROR", t.getMessage());
388
+ }
389
+ }
390
+
343
391
  @ReactMethod
344
392
  public void removeGlobalContexts(ReadableMap details,
345
393
  Promise promise) {
@@ -158,6 +158,9 @@ public class ConfigUtil {
158
158
  if (trackerConfig.hasKey("diagnosticAutotracking")) {
159
159
  trackerConfiguration.diagnosticAutotracking(trackerConfig.getBoolean("diagnosticAutotracking"));
160
160
  }
161
+ if (trackerConfig.hasKey("deepLinkContext")) {
162
+ trackerConfiguration.deepLinkContext(trackerConfig.getBoolean("deepLinkContext"));
163
+ }
161
164
 
162
165
  return trackerConfiguration;
163
166
  }
@@ -193,7 +196,7 @@ public class ConfigUtil {
193
196
  int byteLimitPost = (int) emitterConfig.getDouble("byteLimitPost");
194
197
  emitterConfiguration.byteLimitPost(byteLimitPost);
195
198
  }
196
- if (emitterConfig.hasKey("byteLimitPost")) {
199
+ if (emitterConfig.hasKey("byteLimitGet")) {
197
200
  int byteLimitGet = (int) emitterConfig.getDouble("byteLimitGet");
198
201
  emitterConfiguration.byteLimitGet(byteLimitGet);
199
202
  }
@@ -1,8 +1,13 @@
1
1
  package com.snowplowanalytics.react.util;
2
2
 
3
+ import androidx.annotation.NonNull;
4
+
3
5
  import com.facebook.react.bridge.ReadableMap;
4
6
  import com.facebook.react.bridge.ReadableArray;
5
- import com.snowplowanalytics.snowplow.event.SelfDescribing;
7
+ import com.snowplowanalytics.snowplow.event.DeepLinkReceived;
8
+ import com.snowplowanalytics.snowplow.event.MessageNotification;
9
+ import com.snowplowanalytics.snowplow.event.MessageNotificationAttachment;
10
+ import com.snowplowanalytics.snowplow.event.MessageNotificationTrigger;
6
11
  import com.snowplowanalytics.snowplow.event.Structured;
7
12
  import com.snowplowanalytics.snowplow.payload.SelfDescribingJson;
8
13
  import com.snowplowanalytics.snowplow.event.ScreenView;
@@ -15,6 +20,7 @@ import com.snowplowanalytics.snowplow.event.EcommerceTransaction;
15
20
 
16
21
  import java.util.ArrayList;
17
22
  import java.util.List;
23
+ import java.util.Objects;
18
24
  import java.util.UUID;
19
25
 
20
26
  public class EventUtil {
@@ -37,165 +43,297 @@ public class EventUtil {
37
43
  }
38
44
 
39
45
  public static Structured createStructuredEvent(ReadableMap argmap) {
40
- Structured.Builder eventBuilder = Structured.builder()
41
- .category(argmap.getString("category"))
42
- .action(argmap.getString("action"));
46
+ Structured event = new Structured(
47
+ Objects.requireNonNull(argmap.getString("category"), "category can't be null"),
48
+ Objects.requireNonNull(argmap.getString("action"), "action can't be null")
49
+ );
43
50
 
44
51
  if (argmap.hasKey("label")) {
45
- eventBuilder.label(argmap.getString("label"));
52
+ event.label(argmap.getString("label"));
46
53
  }
47
54
  if (argmap.hasKey("property")) {
48
- eventBuilder.property(argmap.getString("property"));
55
+ event.property(argmap.getString("property"));
49
56
  }
50
57
  // React Native forces primitive double type - so null "value" parameter is handled by not setting at all
51
58
  if (argmap.hasKey("value") && !argmap.isNull("value")) {
52
- eventBuilder.value(argmap.getDouble("value"));
59
+ event.value(argmap.getDouble("value"));
53
60
  }
54
61
 
55
- return eventBuilder.build();
62
+ return event;
56
63
  }
57
64
 
58
65
  public static ScreenView createScreenViewEvent(ReadableMap argmap) {
59
- ScreenView.Builder eventBuilder = ScreenView.builder()
60
- .name(argmap.getString("name"));
66
+ @NonNull String name = Objects.requireNonNull(argmap.getString("name"), "name can't be null");
67
+ ScreenView event = (
68
+ argmap.hasKey("id") ?
69
+ new ScreenView(name, UUID.fromString(argmap.getString("id"))) :
70
+ new ScreenView(name)
71
+ );
61
72
 
62
- if (argmap.hasKey("id")) {
63
- UUID idUUID = UUID.fromString(argmap.getString("id"));
64
- eventBuilder.id(idUUID.toString());
65
- }
66
73
  if (argmap.hasKey("type")) {
67
- eventBuilder.type(argmap.getString("type"));
74
+ event.type(argmap.getString("type"));
68
75
  }
69
76
  if (argmap.hasKey("previousName")) {
70
- eventBuilder.previousName(argmap.getString("previousName"));
77
+ event.previousName(argmap.getString("previousName"));
71
78
  }
72
79
  if (argmap.hasKey("previousType")) {
73
- eventBuilder.previousType(argmap.getString("previousType"));
80
+ event.previousType(argmap.getString("previousType"));
74
81
  }
75
82
  if (argmap.hasKey("previousId")) {
76
- eventBuilder.previousId(argmap.getString("previousId"));
83
+ event.previousId(argmap.getString("previousId"));
77
84
  }
78
85
  if (argmap.hasKey("transitionType")) {
79
- eventBuilder.transitionType(argmap.getString("transitionType"));
86
+ event.transitionType(argmap.getString("transitionType"));
80
87
  }
81
88
 
82
- return eventBuilder.build();
89
+ return event;
83
90
  }
84
91
 
85
92
  public static PageView createPageViewEvent(ReadableMap argmap) {
86
- PageView.Builder eventBuilder = PageView.builder()
87
- .pageUrl(argmap.getString("pageUrl"));
93
+ PageView event = new PageView(
94
+ Objects.requireNonNull(argmap.getString("pageUrl"), "pageUrl can't be null")
95
+ );
88
96
 
89
97
  if (argmap.hasKey("pageTitle")) {
90
- eventBuilder.pageTitle(argmap.getString("pageTitle"));
98
+ event.pageTitle(argmap.getString("pageTitle"));
91
99
  }
92
100
  if (argmap.hasKey("referrer")) {
93
- eventBuilder.referrer(argmap.getString("referrer"));
101
+ event.referrer(argmap.getString("referrer"));
94
102
  }
95
103
 
96
- return eventBuilder.build();
104
+ return event;
97
105
  }
98
106
 
99
107
  public static Timing createTimingEvent(ReadableMap argmap) {
100
- Timing.Builder eventBuilder = Timing.builder()
101
- .category(argmap.getString("category"))
102
- .variable(argmap.getString("variable"))
103
- .timing(argmap.getInt("timing"));
108
+ Timing event = new Timing(
109
+ Objects.requireNonNull(argmap.getString("category"), "category can't be null"),
110
+ Objects.requireNonNull(argmap.getString("variable"), "variable can't be null"),
111
+ argmap.getInt("timing")
112
+ );
104
113
 
105
114
  if (argmap.hasKey("label")) {
106
- eventBuilder.label(argmap.getString("label"));
115
+ event.label(argmap.getString("label"));
107
116
  }
108
117
 
109
- return eventBuilder.build();
118
+ return event;
110
119
  }
111
120
 
112
121
  public static ConsentGranted createConsentGrantedEvent(ReadableMap argmap) {
113
- ConsentGranted.Builder eventBuilder = ConsentGranted.builder()
114
- .expiry(argmap.getString("expiry"))
115
- .documentId(argmap.getString("documentId"))
116
- .documentVersion(argmap.getString("version"));
122
+ ConsentGranted event = new ConsentGranted(
123
+ Objects.requireNonNull(argmap.getString("expiry"), "expiry can't be null"),
124
+ Objects.requireNonNull(argmap.getString("documentId"), "documentId can't be null"),
125
+ Objects.requireNonNull(argmap.getString("version"), "version can't be null")
126
+ );
117
127
 
118
128
  if (argmap.hasKey("name")) {
119
- eventBuilder.documentName(argmap.getString("name"));
129
+ event.documentName(argmap.getString("name"));
120
130
  }
121
131
  if (argmap.hasKey("documentDescription")) {
122
- eventBuilder.documentDescription(argmap.getString("documentDescription"));
132
+ event.documentDescription(argmap.getString("documentDescription"));
123
133
  }
124
134
 
125
- return eventBuilder.build();
135
+ return event;
126
136
  }
127
137
 
128
138
  public static ConsentWithdrawn createConsentWithdrawnEvent(ReadableMap argmap) {
129
- ConsentWithdrawn.Builder eventBuilder = ConsentWithdrawn.builder()
130
- .all(argmap.getBoolean("all"))
131
- .documentId(argmap.getString("documentId"))
132
- .documentVersion(argmap.getString("version"));
139
+ ConsentWithdrawn event = new ConsentWithdrawn(
140
+ argmap.getBoolean("all"),
141
+ Objects.requireNonNull(argmap.getString("documentId"), "documentId can't be null"),
142
+ Objects.requireNonNull(argmap.getString("version"), "version can't be null")
143
+ );
133
144
 
134
145
  if (argmap.hasKey("name")) {
135
- eventBuilder.documentName(argmap.getString("name"));
146
+ event.documentName(argmap.getString("name"));
136
147
  }
137
148
  if (argmap.hasKey("documentDescription")) {
138
- eventBuilder.documentDescription(argmap.getString("documentDescription"));
149
+ event.documentDescription(argmap.getString("documentDescription"));
139
150
  }
140
151
 
141
- return eventBuilder.build();
152
+ return event;
142
153
  }
143
154
 
144
155
  public static List<EcommerceTransactionItem> createEcommerceTransactionItems(ReadableArray items) {
145
156
  List<EcommerceTransactionItem> ecomItems = new ArrayList<>();
146
157
  for (int i = 0; i < items.size(); i++) {
147
158
  ReadableMap argItem = items.getMap(i);
148
- EcommerceTransactionItem.Builder itemBuilder = EcommerceTransactionItem.builder()
149
- .sku(argItem.getString("sku"))
150
- .price(argItem.getDouble("price"))
151
- .quantity(argItem.getInt("quantity"));
159
+ EcommerceTransactionItem item = new EcommerceTransactionItem(
160
+ Objects.requireNonNull(argItem.getString("sku"), "sku can't be null"),
161
+ argItem.getDouble("price"),
162
+ argItem.getInt("quantity")
163
+ );
152
164
 
153
165
  if (argItem.hasKey("name")) {
154
- itemBuilder.name(argItem.getString("name"));
166
+ item.name(argItem.getString("name"));
155
167
  }
156
168
  if (argItem.hasKey("category")) {
157
- itemBuilder.category(argItem.getString("category"));
169
+ item.category(argItem.getString("category"));
158
170
  }
159
171
  if (argItem.hasKey("currency")) {
160
- itemBuilder.currency(argItem.getString("currency"));
172
+ item.currency(argItem.getString("currency"));
161
173
  }
162
174
 
163
- ecomItems.add(itemBuilder.build());
175
+ ecomItems.add(item);
164
176
  }
165
177
 
166
178
  return ecomItems;
167
- }
179
+ }
168
180
 
169
181
  public static EcommerceTransaction createEcommerceTransactionEvent(ReadableMap argmap) {
170
- List<EcommerceTransactionItem> ecomItems = createEcommerceTransactionItems(argmap.getArray("items"));
182
+ List<EcommerceTransactionItem> ecomItems = createEcommerceTransactionItems(
183
+ Objects.requireNonNull(argmap.getArray("items"), "items can't be null")
184
+ );
171
185
 
172
- EcommerceTransaction.Builder eventBuilder = EcommerceTransaction.builder()
173
- .orderId(argmap.getString("orderId"))
174
- .totalValue(argmap.getDouble("totalValue"))
175
- .items(ecomItems);
186
+ EcommerceTransaction event = new EcommerceTransaction(
187
+ Objects.requireNonNull(argmap.getString("orderId"), "orderId can't be null"),
188
+ argmap.getDouble("totalValue"),
189
+ ecomItems
190
+ );
176
191
 
177
192
  if (argmap.hasKey("affiliation")) {
178
- eventBuilder.affiliation(argmap.getString("affiliation"));
193
+ event.affiliation(argmap.getString("affiliation"));
179
194
  }
180
195
  if (argmap.hasKey("taxValue")) {
181
- eventBuilder.taxValue(argmap.getDouble("taxValue"));
196
+ event.taxValue(argmap.getDouble("taxValue"));
182
197
  }
183
198
  if (argmap.hasKey("shipping")) {
184
- eventBuilder.shipping(argmap.getDouble("shipping"));
199
+ event.shipping(argmap.getDouble("shipping"));
185
200
  }
186
201
  if (argmap.hasKey("city")) {
187
- eventBuilder.city(argmap.getString("city"));
202
+ event.city(argmap.getString("city"));
188
203
  }
189
204
  if (argmap.hasKey("state")) {
190
- eventBuilder.state(argmap.getString("state"));
205
+ event.state(argmap.getString("state"));
191
206
  }
192
207
  if (argmap.hasKey("country")) {
193
- eventBuilder.country(argmap.getString("country"));
208
+ event.country(argmap.getString("country"));
194
209
  }
195
210
  if (argmap.hasKey("currency")) {
196
- eventBuilder.currency(argmap.getString("currency"));
211
+ event.currency(argmap.getString("currency"));
212
+ }
213
+
214
+ return event;
215
+ }
216
+
217
+ public static DeepLinkReceived createDeepLinkReceivedEvent(ReadableMap argmap) {
218
+ DeepLinkReceived event = new DeepLinkReceived(
219
+ Objects.requireNonNull(argmap.getString("url"), "url can't be null")
220
+ );
221
+
222
+ if (argmap.hasKey("referrer")) {
223
+ event.referrer(argmap.getString("referrer"));
224
+ }
225
+
226
+ return event;
227
+ }
228
+
229
+ public static List<MessageNotificationAttachment> createMessageNotificationAttachments(ReadableArray items) {
230
+ List<MessageNotificationAttachment> attachments = new ArrayList<>();
231
+ for (int i = 0; i < items.size(); i++) {
232
+ ReadableMap argItem = items.getMap(i);
233
+ MessageNotificationAttachment attachment = new MessageNotificationAttachment(
234
+ Objects.requireNonNull(argItem.getString("identifier"), "identifier can't be null"),
235
+ Objects.requireNonNull(argItem.getString("type"), "type can't be null"),
236
+ Objects.requireNonNull(argItem.getString("url"), "url can't be null")
237
+ );
238
+ attachments.add(attachment);
239
+ }
240
+
241
+ return attachments;
242
+ }
243
+
244
+ public static List<String> createStrings(ReadableArray items) {
245
+ List<String> results = new ArrayList<>();
246
+ for (int i = 0; i < items.size(); i++) {
247
+ results.add(items.getString(i));
248
+ }
249
+ return results;
250
+ }
251
+
252
+ public static MessageNotification createMessageNotificationEvent(ReadableMap argmap) {
253
+
254
+ MessageNotificationTrigger trigger;
255
+ switch (Objects.requireNonNull(argmap.getString("trigger"), "trigger can't be null")) {
256
+ case "push":
257
+ trigger = MessageNotificationTrigger.push;
258
+ break;
259
+ case "location":
260
+ trigger = MessageNotificationTrigger.location;
261
+ break;
262
+ case "calendar":
263
+ trigger = MessageNotificationTrigger.calendar;
264
+ break;
265
+ case "timeInterval":
266
+ trigger = MessageNotificationTrigger.timeInterval;
267
+ break;
268
+ default:
269
+ trigger = MessageNotificationTrigger.other;
270
+ break;
271
+ }
272
+
273
+ MessageNotification event = new MessageNotification(
274
+ Objects.requireNonNull(argmap.getString("title"), "title can't be null"),
275
+ Objects.requireNonNull(argmap.getString("body"), "body can't be null"),
276
+ trigger
277
+ );
278
+
279
+ if (argmap.hasKey("action")) {
280
+ event.action(argmap.getString("action"));
281
+ }
282
+ if (argmap.hasKey("attachments")) {
283
+ ReadableArray attachments = argmap.getArray("attachments");
284
+ if (attachments != null) {
285
+ event.attachments(createMessageNotificationAttachments(attachments));
286
+ }
287
+ }
288
+ if (argmap.hasKey("bodyLocArgs")) {
289
+ ReadableArray bodyLocArgs = argmap.getArray("bodyLocArgs");
290
+ if (bodyLocArgs != null) {
291
+ event.bodyLocArgs(createStrings(bodyLocArgs));
292
+ }
293
+ }
294
+ if (argmap.hasKey("bodyLocKey")) {
295
+ event.bodyLocKey(argmap.getString("bodyLocKey"));
296
+ }
297
+ if (argmap.hasKey("category")) {
298
+ event.category(argmap.getString("category"));
299
+ }
300
+ if (argmap.hasKey("contentAvailable")) {
301
+ event.contentAvailable(argmap.getBoolean("contentAvailable"));
302
+ }
303
+ if (argmap.hasKey("group")) {
304
+ event.group(argmap.getString("group"));
305
+ }
306
+ if (argmap.hasKey("icon")) {
307
+ event.icon(argmap.getString("icon"));
308
+ }
309
+ if (argmap.hasKey("notificationCount")) {
310
+ event.notificationCount(argmap.getInt("notificationCount"));
311
+ }
312
+ if (argmap.hasKey("notificationTimestamp")) {
313
+ event.notificationTimestamp(argmap.getString("notificationTimestamp"));
314
+ }
315
+ if (argmap.hasKey("sound")) {
316
+ event.sound(argmap.getString("sound"));
317
+ }
318
+ if (argmap.hasKey("subtitle")) {
319
+ event.subtitle(argmap.getString("subtitle"));
320
+ }
321
+ if (argmap.hasKey("tag")) {
322
+ event.tag(argmap.getString("tag"));
323
+ }
324
+ if (argmap.hasKey("threadIdentifier")) {
325
+ event.threadIdentifier(argmap.getString("threadIdentifier"));
326
+ }
327
+ if (argmap.hasKey("titleLocArgs")) {
328
+ ReadableArray titleLocArgs = argmap.getArray("titleLocArgs");
329
+ if (titleLocArgs != null) {
330
+ event.titleLocArgs(createStrings(titleLocArgs));
331
+ }
332
+ }
333
+ if (argmap.hasKey("titleLocKey")) {
334
+ event.titleLocKey(argmap.getString("titleLocKey"));
197
335
  }
198
336
 
199
- return eventBuilder.build();
337
+ return event;
200
338
  }
201
339
  }
@@ -2,6 +2,6 @@ package com.snowplowanalytics.react.util;
2
2
 
3
3
  public class TrackerVersion {
4
4
 
5
- public final static String RN_TRACKER_VERSION = "rn-1.0.0-beta.1";
5
+ public final static String RN_TRACKER_VERSION = "rn-1.2.0";
6
6
 
7
7
  }