@snowplow/react-native-tracker 1.2.1 → 1.4.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/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-2022 Snowplow Analytics Ltd, 2019 DataCamp.
190
+ Copyright (c) 2020-2023 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
@@ -199,7 +199,7 @@ Feedback and contributions are welcome - if you have identified a bug, please lo
199
199
 
200
200
  ## Copyright and license
201
201
 
202
- The Snowplow React Native Tracker is copyright 2020-2022 Snowplow Analytics Ltd, 2019 DataCamp.
202
+ The Snowplow React Native Tracker is copyright 2020-2023 Snowplow Analytics Ltd, 2019 DataCamp.
203
203
 
204
204
  Licensed under the **[Apache License, Version 2.0][license]** (the "License");
205
205
  you may not use this software except in compliance with the License.
@@ -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", "~> 3.0"
23
+ s.dependency "SnowplowTracker", "~> 4.1"
24
24
  end
@@ -50,5 +50,5 @@ dependencies {
50
50
  // Required Dependency for the Tracker
51
51
  implementation "com.squareup.okhttp3:okhttp:4.9.3"
52
52
  implementation "com.facebook.react:react-native:+"
53
- implementation 'com.snowplowanalytics:snowplow-android-tracker:3.+'
53
+ implementation 'com.snowplowanalytics:snowplow-android-tracker:4.1.+'
54
54
  }
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
3
3
  distributionPath=wrapper/dists
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
6
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
@@ -8,12 +8,12 @@ import com.facebook.react.bridge.Promise;
8
8
  import com.facebook.react.bridge.ReadableArray;
9
9
  import com.facebook.react.bridge.ReadableMap;
10
10
 
11
+ import com.facebook.react.bridge.ReadableMapKeySetIterator;
11
12
  import com.snowplowanalytics.snowplow.Snowplow;
12
13
  import com.snowplowanalytics.snowplow.configuration.Configuration;
13
14
  import com.snowplowanalytics.snowplow.configuration.EmitterConfiguration;
14
15
  import com.snowplowanalytics.snowplow.configuration.GdprConfiguration;
15
16
  import com.snowplowanalytics.snowplow.configuration.NetworkConfiguration;
16
- import com.snowplowanalytics.snowplow.configuration.RemoteConfiguration;
17
17
  import com.snowplowanalytics.snowplow.configuration.SessionConfiguration;
18
18
  import com.snowplowanalytics.snowplow.configuration.TrackerConfiguration;
19
19
  import com.snowplowanalytics.snowplow.configuration.SubjectConfiguration;
@@ -22,6 +22,7 @@ import com.snowplowanalytics.snowplow.event.DeepLinkReceived;
22
22
  import com.snowplowanalytics.snowplow.event.MessageNotification;
23
23
  import com.snowplowanalytics.snowplow.globalcontexts.GlobalContext;
24
24
  import com.snowplowanalytics.snowplow.controller.TrackerController;
25
+ import com.snowplowanalytics.snowplow.network.CollectorCookieJar;
25
26
  import com.snowplowanalytics.snowplow.payload.SelfDescribingJson;
26
27
  import com.snowplowanalytics.snowplow.event.SelfDescribing;
27
28
  import com.snowplowanalytics.snowplow.event.ScreenView;
@@ -30,18 +31,20 @@ import com.snowplowanalytics.snowplow.event.PageView;
30
31
  import com.snowplowanalytics.snowplow.event.Timing;
31
32
  import com.snowplowanalytics.snowplow.event.ConsentGranted;
32
33
  import com.snowplowanalytics.snowplow.event.ConsentWithdrawn;
33
- import com.snowplowanalytics.snowplow.event.EcommerceTransactionItem;
34
34
  import com.snowplowanalytics.snowplow.event.EcommerceTransaction;
35
35
  import com.snowplowanalytics.snowplow.network.HttpMethod;
36
- import com.snowplowanalytics.snowplow.internal.utils.Util;
37
36
  import com.snowplowanalytics.snowplow.util.Size;
38
37
 
39
38
  import java.util.List;
40
39
  import java.util.ArrayList;
40
+ import java.util.concurrent.TimeUnit;
41
41
 
42
42
  import com.snowplowanalytics.react.util.EventUtil;
43
43
  import com.snowplowanalytics.react.util.ConfigUtil;
44
44
 
45
+ import okhttp3.OkHttpClient;
46
+ import okhttp3.Request;
47
+
45
48
  public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
46
49
 
47
50
  private final ReactApplicationContext reactContext;
@@ -73,6 +76,30 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
73
76
  } else {
74
77
  networkConfiguration = new NetworkConfiguration(networkConfig.getString("endpoint"));
75
78
  }
79
+ if (networkConfig.hasKey("customPostPath") && !networkConfig.isNull("customPostPath")) {
80
+ String customPostPath = networkConfig.getString("customPostPath");
81
+ networkConfiguration.customPostPath = customPostPath;
82
+ }
83
+ if (networkConfig.hasKey("requestHeaders") && !networkConfig.isNull("requestHeaders")) {
84
+ ReadableMap requestHeaders = networkConfig.getMap("requestHeaders");
85
+ if (requestHeaders != null) {
86
+ OkHttpClient client = new OkHttpClient.Builder()
87
+ .connectTimeout(15, TimeUnit.SECONDS)
88
+ .readTimeout(15, TimeUnit.SECONDS)
89
+ .cookieJar(new CollectorCookieJar(reactContext))
90
+ .addInterceptor(chain -> {
91
+ Request.Builder requestBuilder = chain.request().newBuilder();
92
+ ReadableMapKeySetIterator it = requestHeaders.keySetIterator();
93
+ while (it.hasNextKey()) {
94
+ String key = it.nextKey();
95
+ String value = requestHeaders.getString(key);
96
+ if (value != null) { requestBuilder.header(key, value); }
97
+ }
98
+ return chain.proceed(requestBuilder.build());
99
+ }).build();
100
+ networkConfiguration.okHttpClient(client);
101
+ }
102
+ }
76
103
 
77
104
  // Configurations
78
105
  List<Configuration> controllers = new ArrayList<Configuration>();
@@ -137,7 +164,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
137
164
  Promise promise) {
138
165
  try {
139
166
  String namespace = details.getString("tracker");
140
- TrackerController trackerController = Snowplow.getTracker(namespace);
167
+ TrackerController trackerController = getTracker(namespace);
141
168
 
142
169
  promise.resolve(Snowplow.removeTracker(trackerController));
143
170
 
@@ -165,7 +192,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
165
192
  ReadableMap argmap = details.getMap("eventData");
166
193
  ReadableArray contexts = details.getArray("contexts");
167
194
 
168
- TrackerController trackerController = Snowplow.getTracker(namespace);
195
+ TrackerController trackerController = getTracker(namespace);
169
196
 
170
197
  SelfDescribingJson sdj = EventUtil.createSelfDescribingJson(argmap);
171
198
  SelfDescribing event = new SelfDescribing(sdj);
@@ -189,7 +216,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
189
216
  ReadableMap argmap = details.getMap("eventData");
190
217
  ReadableArray contexts = details.getArray("contexts");
191
218
 
192
- TrackerController trackerController = Snowplow.getTracker(namespace);
219
+ TrackerController trackerController = getTracker(namespace);
193
220
 
194
221
  Structured event = EventUtil.createStructuredEvent(argmap);
195
222
 
@@ -212,7 +239,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
212
239
  ReadableMap argmap = details.getMap("eventData");
213
240
  ReadableArray contexts = details.getArray("contexts");
214
241
 
215
- TrackerController trackerController = Snowplow.getTracker(namespace);
242
+ TrackerController trackerController = getTracker(namespace);
216
243
 
217
244
  ScreenView event = EventUtil.createScreenViewEvent(argmap);
218
245
 
@@ -235,7 +262,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
235
262
  ReadableMap argmap = details.getMap("eventData");
236
263
  ReadableArray contexts = details.getArray("contexts");
237
264
 
238
- TrackerController trackerController = Snowplow.getTracker(namespace);
265
+ TrackerController trackerController = getTracker(namespace);
239
266
 
240
267
  PageView event = EventUtil.createPageViewEvent(argmap);
241
268
 
@@ -258,7 +285,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
258
285
  ReadableMap argmap = details.getMap("eventData");
259
286
  ReadableArray contexts = details.getArray("contexts");
260
287
 
261
- TrackerController trackerController = Snowplow.getTracker(namespace);
288
+ TrackerController trackerController = getTracker(namespace);
262
289
 
263
290
  Timing event = EventUtil.createTimingEvent(argmap);
264
291
 
@@ -281,7 +308,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
281
308
  ReadableMap argmap = details.getMap("eventData");
282
309
  ReadableArray contexts = details.getArray("contexts");
283
310
 
284
- TrackerController trackerController = Snowplow.getTracker(namespace);
311
+ TrackerController trackerController = getTracker(namespace);
285
312
 
286
313
  ConsentGranted event = EventUtil.createConsentGrantedEvent(argmap);
287
314
 
@@ -304,7 +331,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
304
331
  ReadableMap argmap = details.getMap("eventData");
305
332
  ReadableArray contexts = details.getArray("contexts");
306
333
 
307
- TrackerController trackerController = Snowplow.getTracker(namespace);
334
+ TrackerController trackerController = getTracker(namespace);
308
335
 
309
336
  ConsentWithdrawn event = EventUtil.createConsentWithdrawnEvent(argmap);
310
337
 
@@ -327,7 +354,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
327
354
  ReadableMap argmap = details.getMap("eventData");
328
355
  ReadableArray contexts = details.getArray("contexts");
329
356
 
330
- TrackerController trackerController = Snowplow.getTracker(namespace);
357
+ TrackerController trackerController = getTracker(namespace);
331
358
 
332
359
  EcommerceTransaction event = EventUtil.createEcommerceTransactionEvent(argmap);
333
360
 
@@ -350,7 +377,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
350
377
  ReadableMap argmap = details.getMap("eventData");
351
378
  ReadableArray contexts = details.getArray("contexts");
352
379
 
353
- TrackerController trackerController = Snowplow.getTracker(namespace);
380
+ TrackerController trackerController = getTracker(namespace);
354
381
 
355
382
  DeepLinkReceived event = EventUtil.createDeepLinkReceivedEvent(argmap);
356
383
 
@@ -373,7 +400,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
373
400
  ReadableMap argmap = details.getMap("eventData");
374
401
  ReadableArray contexts = details.getArray("contexts");
375
402
 
376
- TrackerController trackerController = Snowplow.getTracker(namespace);
403
+ TrackerController trackerController = getTracker(namespace);
377
404
 
378
405
  MessageNotification event = EventUtil.createMessageNotificationEvent(argmap);
379
406
 
@@ -395,7 +422,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
395
422
  String namespace = details.getString("tracker");
396
423
  String tag = details.getString("removeTag");
397
424
 
398
- TrackerController trackerController = Snowplow.getTracker(namespace);
425
+ TrackerController trackerController = getTracker(namespace);
399
426
 
400
427
  trackerController.getGlobalContexts().remove(tag);
401
428
  promise.resolve(true);
@@ -422,7 +449,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
422
449
  }
423
450
  GlobalContext gcStatic = new GlobalContext(staticContexts);
424
451
 
425
- TrackerController trackerController = Snowplow.getTracker(namespace);
452
+ TrackerController trackerController = getTracker(namespace);
426
453
 
427
454
  trackerController.getGlobalContexts().add(tag, gcStatic);
428
455
  promise.resolve(true);
@@ -437,7 +464,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
437
464
  Promise promise) {
438
465
  try {
439
466
  String namespace = details.getString("tracker");
440
- TrackerController trackerController = Snowplow.getTracker(namespace);
467
+ TrackerController trackerController = getTracker(namespace);
441
468
 
442
469
  if (details.isNull("userId")) {
443
470
  trackerController.getSubject().setUserId(null);
@@ -456,7 +483,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
456
483
  Promise promise) {
457
484
  try {
458
485
  String namespace = details.getString("tracker");
459
- TrackerController trackerController = Snowplow.getTracker(namespace);
486
+ TrackerController trackerController = getTracker(namespace);
460
487
 
461
488
  if (details.isNull("networkUserId")) {
462
489
  trackerController.getSubject().setNetworkUserId(null);
@@ -475,7 +502,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
475
502
  Promise promise) {
476
503
  try {
477
504
  String namespace = details.getString("tracker");
478
- TrackerController trackerController = Snowplow.getTracker(namespace);
505
+ TrackerController trackerController = getTracker(namespace);
479
506
 
480
507
  if (details.isNull("domainUserId")) {
481
508
  trackerController.getSubject().setDomainUserId(null);
@@ -494,7 +521,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
494
521
  Promise promise) {
495
522
  try {
496
523
  String namespace = details.getString("tracker");
497
- TrackerController trackerController = Snowplow.getTracker(namespace);
524
+ TrackerController trackerController = getTracker(namespace);
498
525
 
499
526
  if (details.isNull("ipAddress")) {
500
527
  trackerController.getSubject().setIpAddress(null);
@@ -513,7 +540,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
513
540
  Promise promise) {
514
541
  try {
515
542
  String namespace = details.getString("tracker");
516
- TrackerController trackerController = Snowplow.getTracker(namespace);
543
+ TrackerController trackerController = getTracker(namespace);
517
544
 
518
545
  if (details.isNull("useragent")) {
519
546
  trackerController.getSubject().setUseragent(null);
@@ -532,7 +559,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
532
559
  Promise promise) {
533
560
  try {
534
561
  String namespace = details.getString("tracker");
535
- TrackerController trackerController = Snowplow.getTracker(namespace);
562
+ TrackerController trackerController = getTracker(namespace);
536
563
 
537
564
  if (details.isNull("timezone")) {
538
565
  trackerController.getSubject().setTimezone(null);
@@ -551,7 +578,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
551
578
  Promise promise) {
552
579
  try {
553
580
  String namespace = details.getString("tracker");
554
- TrackerController trackerController = Snowplow.getTracker(namespace);
581
+ TrackerController trackerController = getTracker(namespace);
555
582
 
556
583
  if (details.isNull("language")) {
557
584
  trackerController.getSubject().setLanguage(null);
@@ -570,7 +597,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
570
597
  Promise promise) {
571
598
  try {
572
599
  String namespace = details.getString("tracker");
573
- TrackerController trackerController = Snowplow.getTracker(namespace);
600
+ TrackerController trackerController = getTracker(namespace);
574
601
 
575
602
  if (details.isNull("screenResolution")) {
576
603
  trackerController.getSubject().setScreenResolution(null);
@@ -594,7 +621,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
594
621
  Promise promise) {
595
622
  try {
596
623
  String namespace = details.getString("tracker");
597
- TrackerController trackerController = Snowplow.getTracker(namespace);
624
+ TrackerController trackerController = getTracker(namespace);
598
625
 
599
626
  if (details.isNull("screenViewport")) {
600
627
  trackerController.getSubject().setScreenViewPort(null);
@@ -618,7 +645,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
618
645
  Promise promise) {
619
646
  try {
620
647
  String namespace = details.getString("tracker");
621
- TrackerController trackerController = Snowplow.getTracker(namespace);
648
+ TrackerController trackerController = getTracker(namespace);
622
649
 
623
650
  if (details.isNull("colorDepth")) {
624
651
  trackerController.getSubject().setColorDepth(null);
@@ -637,7 +664,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
637
664
  Promise promise) {
638
665
  try {
639
666
  String namespace = details.getString("tracker");
640
- TrackerController trackerController = Snowplow.getTracker(namespace);
667
+ TrackerController trackerController = getTracker(namespace);
641
668
 
642
669
  String suid = trackerController.getSession().getUserId();
643
670
  promise.resolve(suid);
@@ -651,7 +678,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
651
678
  Promise promise) {
652
679
  try {
653
680
  String namespace = details.getString("tracker");
654
- TrackerController trackerController = Snowplow.getTracker(namespace);
681
+ TrackerController trackerController = getTracker(namespace);
655
682
 
656
683
  String sid = trackerController.getSession().getSessionId();
657
684
  promise.resolve(sid);
@@ -665,7 +692,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
665
692
  Promise promise) {
666
693
  try {
667
694
  String namespace = details.getString("tracker");
668
- TrackerController trackerController = Snowplow.getTracker(namespace);
695
+ TrackerController trackerController = getTracker(namespace);
669
696
 
670
697
  int sidx = trackerController.getSession().getSessionIndex();
671
698
  promise.resolve(sidx);
@@ -679,7 +706,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
679
706
  Promise promise) {
680
707
  try {
681
708
  String namespace = details.getString("tracker");
682
- TrackerController trackerController = Snowplow.getTracker(namespace);
709
+ TrackerController trackerController = getTracker(namespace);
683
710
 
684
711
  boolean isInBg = trackerController.getSession().isInBackground();
685
712
  promise.resolve(isInBg);
@@ -693,7 +720,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
693
720
  Promise promise) {
694
721
  try {
695
722
  String namespace = details.getString("tracker");
696
- TrackerController trackerController = Snowplow.getTracker(namespace);
723
+ TrackerController trackerController = getTracker(namespace);
697
724
 
698
725
  int bgIdx = trackerController.getSession().getBackgroundIndex();
699
726
  promise.resolve(bgIdx);
@@ -707,7 +734,7 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
707
734
  Promise promise) {
708
735
  try {
709
736
  String namespace = details.getString("tracker");
710
- TrackerController trackerController = Snowplow.getTracker(namespace);
737
+ TrackerController trackerController = getTracker(namespace);
711
738
 
712
739
  int fgIdx = trackerController.getSession().getForegroundIndex();
713
740
  promise.resolve(fgIdx);
@@ -716,4 +743,8 @@ public class RNSnowplowTrackerModule extends ReactContextBaseJavaModule {
716
743
  }
717
744
  }
718
745
 
746
+ private TrackerController getTracker(String namespace) {
747
+ return namespace == null ? Snowplow.getDefaultTracker() : Snowplow.getTracker(namespace);
748
+ }
749
+
719
750
  }
@@ -161,6 +161,9 @@ public class ConfigUtil {
161
161
  if (trackerConfig.hasKey("deepLinkContext")) {
162
162
  trackerConfiguration.deepLinkContext(trackerConfig.getBoolean("deepLinkContext"));
163
163
  }
164
+ if (trackerConfig.hasKey("userAnonymisation")) {
165
+ trackerConfiguration.userAnonymisation(trackerConfig.getBoolean("userAnonymisation"));
166
+ }
164
167
 
165
168
  return trackerConfiguration;
166
169
  }
@@ -200,6 +203,9 @@ public class ConfigUtil {
200
203
  int byteLimitGet = (int) emitterConfig.getDouble("byteLimitGet");
201
204
  emitterConfiguration.byteLimitGet(byteLimitGet);
202
205
  }
206
+ if (emitterConfig.hasKey("serverAnonymisation")) {
207
+ emitterConfiguration.serverAnonymisation(emitterConfig.getBoolean("serverAnonymisation"));
208
+ }
203
209
 
204
210
  return emitterConfiguration;
205
211
  }
@@ -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.2.1";
5
+ public final static String RN_TRACKER_VERSION = "rn-1.4.0";
6
6
 
7
7
  }
package/dist/index.d.ts CHANGED
@@ -57,6 +57,17 @@ interface NetworkConfiguration {
57
57
  * @defaultValue 'post'
58
58
  */
59
59
  method?: HttpMethod;
60
+ /**
61
+ * A custom path which will be added to the endpoint URL to specify the
62
+ * complete URL of the collector when paired with the POST method.
63
+ *
64
+ * @defaultValue `com.snowplowanalytics.snowplow/tp2`.
65
+ */
66
+ customPostPath?: string;
67
+ /**
68
+ * Custom headers for HTTP requests to the Collector.
69
+ */
70
+ requestHeaders?: Record<string, string>;
60
71
  }
61
72
  /**
62
73
  * TrackerConfiguration
@@ -136,6 +147,11 @@ interface TrackerConfiguration {
136
147
  * @defaultValue false
137
148
  */
138
149
  diagnosticAutotracking?: boolean;
150
+ /**
151
+ * Whether to anonymise client-side user identifiers in session and platform context entities
152
+ * @defaultValue false
153
+ */
154
+ userAnonymisation?: boolean;
139
155
  }
140
156
  /**
141
157
  * SessionConfiguration
@@ -181,6 +197,11 @@ interface EmitterConfiguration {
181
197
  * @defaultValue 40000
182
198
  */
183
199
  byteLimitGet?: number;
200
+ /**
201
+ * Whether to anonymise server-side user identifiers including the `network_userid` and `user_ipaddress`
202
+ * @defaultValue false
203
+ */
204
+ serverAnonymisation?: boolean;
184
205
  }
185
206
  /**
186
207
  * SubjectConfiguration
@@ -728,6 +749,21 @@ declare type ReactNativeTracker = {
728
749
  readonly getForegroundIndex: () => Promise<number | undefined>;
729
750
  };
730
751
 
752
+ /**
753
+ * Enables tracking events from apps rendered in react-native-webview components.
754
+ * The apps need to use the Snowplow WebView tracker to track the events.
755
+ *
756
+ * To subscribe for the events, set the `onMessage` attribute:
757
+ * <WebView onMessage={getWebViewCallback()} ... />
758
+ *
759
+ * @returns Callback to subscribe for events from Web views tracked using the Snowplow WebView tracker.
760
+ */
761
+ declare function getWebViewCallback(): (message: {
762
+ nativeEvent: {
763
+ data: string;
764
+ };
765
+ }) => void;
766
+
731
767
  /**
732
768
  * Creates a React Native Tracker object
733
769
  *
@@ -751,4 +787,4 @@ declare function removeTracker(trackerNamespace: string): Promise<boolean>;
751
787
  */
752
788
  declare function removeAllTrackers(): Promise<boolean>;
753
789
 
754
- export { Basis, BufferOption, ConsentDocument, ConsentGrantedProps, ConsentWithdrawnProps, DeepLinkReceivedProps, DevicePlatform, EcommerceItem, EcommerceTransactionProps, EmitterConfiguration, EventContext, GCConfiguration, GdprConfiguration, GlobalContext, HttpMethod, LogLevel, MessageNotificationProps, NetworkConfiguration, PageViewProps, ReactNativeTracker, ScreenSize, ScreenViewProps, SelfDescribing, SessionConfiguration, StructuredProps, SubjectConfiguration, TimingProps, TrackerConfiguration, TrackerControllerConfiguration, Trigger, createTracker, removeAllTrackers, removeTracker };
790
+ export { Basis, BufferOption, ConsentDocument, ConsentGrantedProps, ConsentWithdrawnProps, DeepLinkReceivedProps, DevicePlatform, EcommerceItem, EcommerceTransactionProps, EmitterConfiguration, EventContext, GCConfiguration, GdprConfiguration, GlobalContext, HttpMethod, LogLevel, MessageNotificationProps, NetworkConfiguration, PageViewProps, ReactNativeTracker, ScreenSize, ScreenViewProps, SelfDescribing, SessionConfiguration, StructuredProps, SubjectConfiguration, TimingProps, TrackerConfiguration, TrackerControllerConfiguration, Trigger, createTracker, getWebViewCallback, removeAllTrackers, removeTracker };