@snowplow/react-native-tracker 2.0.0 → 2.1.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.
Files changed (115) hide show
  1. package/.github/workflows/build.yml +10 -5
  2. package/.github/workflows/deploy.yml +9 -10
  3. package/.github/workflows/e2e-android.yml +2 -2
  4. package/.github/workflows/e2e-ios.yml +6 -1
  5. package/.github/workflows/snyk.yml +1 -1
  6. package/CHANGELOG +14 -0
  7. package/CONTRIBUTING.md +2 -2
  8. package/LICENSE +1 -1
  9. package/README.md +2 -2
  10. package/android/build.gradle +1 -1
  11. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +50 -10
  12. package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +5 -2
  13. package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +20 -0
  14. package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +1 -1
  15. package/example/Gemfile +1 -1
  16. package/example/e2e/emitEvents.e2e.detox.js +0 -13
  17. package/example/e2e/helpers/microCommands.js +0 -13
  18. package/example/e2e/helpers/microHelpers.js +0 -13
  19. package/example/e2e/helpers/microHelpers.test.js +0 -13
  20. package/example/e2e/helpers/schemas.js +0 -13
  21. package/example/e2e/testEvents.micro.test.js +1 -14
  22. package/example/ios/Podfile +0 -2
  23. package/example/ios/Podfile.lock +194 -201
  24. package/example/ios/ReactNativeTrackerExample/PrivacyInfo.xcprivacy +37 -0
  25. package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +17 -0
  26. package/example/package.json +13 -13
  27. package/example/src/App.js +9 -0
  28. package/example/yarn.lock +1599 -1275
  29. package/ios/ReactNativeTracker.mm +10 -0
  30. package/ios/ReactNativeTracker.swift +71 -6
  31. package/ios/Util/ConfigUtils.swift +5 -2
  32. package/ios/Util/TrackerVersion.swift +1 -1
  33. package/lib/commonjs/api.js +28 -13
  34. package/lib/commonjs/api.js.map +1 -1
  35. package/lib/commonjs/configurations.js +1 -14
  36. package/lib/commonjs/configurations.js.map +1 -1
  37. package/lib/commonjs/constants.js +6 -14
  38. package/lib/commonjs/constants.js.map +1 -1
  39. package/lib/commonjs/events.js +34 -13
  40. package/lib/commonjs/events.js.map +1 -1
  41. package/lib/commonjs/index.js +4 -13
  42. package/lib/commonjs/index.js.map +1 -1
  43. package/lib/commonjs/jsCore.js +49 -15
  44. package/lib/commonjs/jsCore.js.map +1 -1
  45. package/lib/commonjs/native.js +0 -13
  46. package/lib/commonjs/native.js.map +1 -1
  47. package/lib/commonjs/subject.js +0 -13
  48. package/lib/commonjs/subject.js.map +1 -1
  49. package/lib/commonjs/tracker.js +40 -13
  50. package/lib/commonjs/tracker.js.map +1 -1
  51. package/lib/commonjs/utils.js +0 -13
  52. package/lib/commonjs/utils.js.map +1 -1
  53. package/lib/commonjs/webViewInterface.js +0 -13
  54. package/lib/commonjs/webViewInterface.js.map +1 -1
  55. package/lib/module/api.js +27 -14
  56. package/lib/module/api.js.map +1 -1
  57. package/lib/module/configurations.js +1 -14
  58. package/lib/module/configurations.js.map +1 -1
  59. package/lib/module/constants.js +6 -14
  60. package/lib/module/constants.js.map +1 -1
  61. package/lib/module/events.js +33 -14
  62. package/lib/module/events.js.map +1 -1
  63. package/lib/module/index.js +4 -13
  64. package/lib/module/index.js.map +1 -1
  65. package/lib/module/jsCore.js +49 -15
  66. package/lib/module/jsCore.js.map +1 -1
  67. package/lib/module/native.js +0 -13
  68. package/lib/module/native.js.map +1 -1
  69. package/lib/module/subject.js +0 -13
  70. package/lib/module/subject.js.map +1 -1
  71. package/lib/module/tracker.js +40 -15
  72. package/lib/module/tracker.js.map +1 -1
  73. package/lib/module/utils.js +0 -13
  74. package/lib/module/utils.js.map +1 -1
  75. package/lib/module/webViewInterface.js +0 -13
  76. package/lib/module/webViewInterface.js.map +1 -1
  77. package/lib/typescript/api.d.ts +16 -2
  78. package/lib/typescript/api.d.ts.map +1 -1
  79. package/lib/typescript/configurations.d.ts.map +1 -1
  80. package/lib/typescript/constants.d.ts +5 -0
  81. package/lib/typescript/constants.d.ts.map +1 -1
  82. package/lib/typescript/events.d.ts +16 -2
  83. package/lib/typescript/events.d.ts.map +1 -1
  84. package/lib/typescript/index.d.ts.map +1 -1
  85. package/lib/typescript/jsCore.d.ts +13 -1
  86. package/lib/typescript/jsCore.d.ts.map +1 -1
  87. package/lib/typescript/native.d.ts.map +1 -1
  88. package/lib/typescript/subject.d.ts.map +1 -1
  89. package/lib/typescript/tracker.d.ts +20 -2
  90. package/lib/typescript/tracker.d.ts.map +1 -1
  91. package/lib/typescript/types.d.ts +83 -5
  92. package/lib/typescript/types.d.ts.map +1 -1
  93. package/lib/typescript/utils.d.ts.map +1 -1
  94. package/lib/typescript/webViewInterface.d.ts.map +1 -1
  95. package/package.json +22 -22
  96. package/snowplow-react-native-tracker.podspec +1 -1
  97. package/src/__tests__/api.test.ts +0 -13
  98. package/src/__tests__/configurations.test.ts +3 -15
  99. package/src/__tests__/events.test.ts +0 -13
  100. package/src/__tests__/index.test.ts +0 -13
  101. package/src/__tests__/jsCore.test.ts +43 -13
  102. package/src/__tests__/utils.test.ts +0 -13
  103. package/src/api.ts +34 -13
  104. package/src/configurations.ts +1 -13
  105. package/src/constants.ts +8 -13
  106. package/src/events.ts +38 -13
  107. package/src/index.ts +8 -13
  108. package/src/jsCore.ts +65 -15
  109. package/src/native.ts +0 -13
  110. package/src/subject.ts +0 -13
  111. package/src/tracker.ts +60 -13
  112. package/src/types.ts +93 -18
  113. package/src/utils.ts +0 -13
  114. package/src/webViewInterface.ts +0 -13
  115. package/yarn.lock +1600 -1535
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Checkout
14
- uses: actions/checkout@v3
14
+ uses: actions/checkout@v4
15
15
 
16
16
  - name: Setup
17
17
  uses: ./.github/actions/setup
@@ -26,7 +26,7 @@ jobs:
26
26
  runs-on: ubuntu-latest
27
27
  steps:
28
28
  - name: Checkout
29
- uses: actions/checkout@v3
29
+ uses: actions/checkout@v4
30
30
 
31
31
  - name: Setup
32
32
  uses: ./.github/actions/setup
@@ -38,7 +38,7 @@ jobs:
38
38
  runs-on: ubuntu-latest
39
39
  steps:
40
40
  - name: Checkout
41
- uses: actions/checkout@v3
41
+ uses: actions/checkout@v4
42
42
 
43
43
  - name: Setup
44
44
  uses: ./.github/actions/setup
@@ -52,7 +52,7 @@ jobs:
52
52
  TURBO_CACHE_DIR: .turbo/android
53
53
  steps:
54
54
  - name: Checkout
55
- uses: actions/checkout@v3
55
+ uses: actions/checkout@v4
56
56
 
57
57
  - name: Setup
58
58
  uses: ./.github/actions/setup
@@ -106,7 +106,12 @@ jobs:
106
106
  TURBO_CACHE_DIR: .turbo/ios
107
107
  steps:
108
108
  - name: Checkout
109
- uses: actions/checkout@v3
109
+ uses: actions/checkout@v4
110
+
111
+ - name: setup-cocoapods
112
+ uses: maxim-lobanov/setup-cocoapods@v1
113
+ with:
114
+ version: 1.15.2
110
115
 
111
116
  - name: Setup
112
117
  uses: ./.github/actions/setup
@@ -1,24 +1,20 @@
1
1
  name: Deploy
2
2
 
3
3
  on:
4
- workflow_run:
5
- workflows: [Build]
6
- types: [completed]
4
+ push:
5
+ tags:
6
+ - '[0-9]+.[0-9]+.[0-9]+*'
7
7
 
8
8
  jobs:
9
9
 
10
10
  version_check:
11
- if: ${{ github.event.workflow_run.conclusion == 'success' }} && startsWith(github.ref, 'refs/tags/') }}
12
11
  runs-on: ubuntu-latest
13
12
  outputs:
14
13
  v_tracker: ${{ steps.version.outputs.RN_TRACKER_VERSION}}
15
14
 
16
15
  steps:
17
16
  - name: Checkout code
18
- uses: actions/checkout@v3
19
-
20
- - name: Setup
21
- uses: ./.github/actions/setup
17
+ uses: actions/checkout@v4
22
18
 
23
19
  - name: Get tag and tracker versions
24
20
  id: version
@@ -27,7 +23,7 @@ jobs:
27
23
  ANDR_VER_FILEPATH: 'android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt'
28
24
  JS_VER_FILEPATH: 'src/jsCore.ts'
29
25
  run: |
30
- echo "TAG_VERSION=${{ github.event.workflow_run.head_branch }}" >> $GITHUB_OUTPUT
26
+ echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
31
27
  echo "RN_TRACKER_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
32
28
  echo "RN_IOS_TRACKER_VERSION=$(cat "${IOS_VER_FILEPATH}" | sed -n -e 's/^.*kRNTrackerVersion = "rn-\(.*\)"/\1/p')" >> $GITHUB_OUTPUT
33
29
  echo "RN_ANDROID_TRACKER_VERSION=$(cat "${ANDR_VER_FILEPATH}" | sed -n -e 's/^.*RN_TRACKER_VERSION = "rn-\(.*\)"/\1/p')" >> $GITHUB_OUTPUT
@@ -58,11 +54,14 @@ jobs:
58
54
 
59
55
  steps:
60
56
  - name: Checkout
61
- uses: actions/checkout@v3
57
+ uses: actions/checkout@v4
62
58
 
63
59
  - name: Setup
64
60
  uses: ./.github/actions/setup
65
61
 
62
+ - name: Run unit tests
63
+ run: yarn test
64
+
66
65
  - name: Build dist files
67
66
  run: |
68
67
  yarn
@@ -5,14 +5,14 @@ on:
5
5
 
6
6
  jobs:
7
7
  e2e:
8
- runs-on: macos-latest
8
+ runs-on: macos-12
9
9
  timeout-minutes: 60
10
10
  env:
11
11
  TURBO_CACHE_DIR: .turbo/android-e2e
12
12
 
13
13
  steps:
14
14
  - name: Checkout
15
- uses: actions/checkout@v3
15
+ uses: actions/checkout@v4
16
16
 
17
17
  - name: Setup
18
18
  uses: ./.github/actions/setup
@@ -5,7 +5,7 @@ on:
5
5
 
6
6
  jobs:
7
7
  e2e:
8
- runs-on: macos-latest
8
+ runs-on: macos-12
9
9
  timeout-minutes: 60
10
10
  env:
11
11
  TURBO_CACHE_DIR: .turbo/ios-e2e
@@ -14,6 +14,11 @@ jobs:
14
14
  - name: Checkout
15
15
  uses: actions/checkout@v2
16
16
 
17
+ - name: setup-cocoapods
18
+ uses: maxim-lobanov/setup-cocoapods@v1
19
+ with:
20
+ version: 1.15.2
21
+
17
22
  - name: Setup
18
23
  uses: ./.github/actions/setup
19
24
 
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v3
13
+ - uses: actions/checkout@v4
14
14
 
15
15
  - name: Run Snyk to check for vulnerabilities
16
16
  uses: snyk/actions/node@master
package/CHANGELOG CHANGED
@@ -1,3 +1,17 @@
1
+ Version 2.1.1 (2024-07-03)
2
+ --------------------------
3
+ Update tracker and example app dependencies
4
+
5
+ Version 2.1.0 (2024-02-21)
6
+ --------------------------
7
+ Upgrade to mobile trackers version 6 and add screen engagement tracking (close #90)
8
+ Fix SelfDescribing extension type (close #204)
9
+ Update JavaScript tracker core version to 3.21.0
10
+ Fix running deploy action only on new tags
11
+ Update cocoapods version
12
+ Lock yarn version to 1.22.19
13
+ Update copyright headers
14
+
1
15
  Version 2.0.0 (2023-09-29)
2
16
  --------------------------
3
17
  Upgrade project structure and update native trackers to version 5 (#199)
package/CONTRIBUTING.md CHANGED
@@ -68,7 +68,7 @@ If your pull request is fairly chunky, there might be a non-trivial delay betwee
68
68
  ### Contributor license agreement
69
69
 
70
70
  We require outside contributors to sign a Contributor license agreement (or CLA) before we can merge their pull requests.
71
- You can find more information on the topic in [the dedicated wiki page](https://github.com/snowplow/snowplow/wiki/CLA).
71
+ You can find more information on the topic in [the dedicated wiki page](https://docs.snowplow.io/docs/contributing/contributor-license-agreement/).
72
72
  The @snowplowcla bot will guide you through the process.
73
73
 
74
74
  ## Getting in touch
@@ -77,4 +77,4 @@ The @snowplowcla bot will guide you through the process.
77
77
 
78
78
  Please do not log an issue if you are asking for support, all of our community support requests go through our Discourse forum: https://discourse.snowplowanalytics.com/.
79
79
 
80
- Posting your problem there ensures more people will see it and you should get support faster than creating a new issue on GitHub. Please do create a new issue on GitHub if you think you've found a bug though!
80
+ Posting your problem there ensures more people will see it and you should get support faster than creating a new issue on GitHub. Please do create a new issue on GitHub if you think you've found a bug though!
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-2023 Snowplow Analytics Ltd, 2019 DataCamp.
190
+ Copyright (c) 2020-present 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
@@ -48,7 +48,7 @@ tracker.trackScreenViewEvent({ name: 'myScreenName' });
48
48
 
49
49
  The Snowplow React Native Tracker also provides first-class support for TypeScript, as it is fully typed.
50
50
 
51
- See also our [DemoApp][demoapp] for an example implementation.
51
+ See also our [DemoApp](example) for an example implementation.
52
52
 
53
53
  ## Find out more
54
54
 
@@ -113,7 +113,7 @@ Feedback and contributions are welcome - if you have identified a bug, please lo
113
113
 
114
114
  ## Copyright and license
115
115
 
116
- The Snowplow React Native Tracker is copyright 2020-2023 Snowplow Analytics Ltd, 2019 DataCamp.
116
+ The Snowplow React Native Tracker is copyright 2020-present Snowplow Analytics Ltd, 2019 DataCamp.
117
117
 
118
118
  Licensed under the **[Apache License, Version 2.0][license]** (the "License");
119
119
  you may not use this software except in compliance with the License.
@@ -97,7 +97,7 @@ dependencies {
97
97
  //noinspection GradleDynamicVersion
98
98
  implementation "com.facebook.react:react-native:+"
99
99
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
100
- implementation "com.snowplowanalytics:snowplow-android-tracker:5.4.4"
100
+ implementation "com.snowplowanalytics:snowplow-android-tracker:6.0.+"
101
101
  implementation "com.squareup.okhttp3:okhttp:4.10.0"
102
102
  }
103
103
 
@@ -177,7 +177,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
177
177
  val sdj: SelfDescribingJson = EventUtil.createSelfDescribingJson(argmap)
178
178
  val event = SelfDescribing(sdj)
179
179
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
180
- event.customContexts.addAll(evCtxts)
180
+ event.entities.addAll(evCtxts)
181
181
  trackerController.track(event)
182
182
  promise.resolve(true)
183
183
  } catch (t: Throwable) {
@@ -197,7 +197,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
197
197
  val trackerController = getTracker(namespace)
198
198
  val event: Structured = EventUtil.createStructuredEvent(argmap)
199
199
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
200
- event.customContexts.addAll(evCtxts)
200
+ event.entities.addAll(evCtxts)
201
201
  trackerController.track(event)
202
202
  promise.resolve(true)
203
203
  } catch (t: Throwable) {
@@ -217,7 +217,47 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
217
217
  val trackerController = getTracker(namespace)
218
218
  val event: ScreenView = EventUtil.createScreenViewEvent(argmap)
219
219
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
220
- event.customContexts.addAll(evCtxts)
220
+ event.entities.addAll(evCtxts)
221
+ trackerController.track(event)
222
+ promise.resolve(true)
223
+ } catch (t: Throwable) {
224
+ promise.reject("ERROR", t.message)
225
+ }
226
+ }
227
+
228
+ @ReactMethod
229
+ fun trackScrollChangedEvent(
230
+ details: ReadableMap,
231
+ promise: Promise
232
+ ) {
233
+ try {
234
+ val namespace = details.getString("tracker")
235
+ val argmap = details.getMap("eventData")!!
236
+ val contexts = details.getArray("contexts")!!
237
+ val trackerController = getTracker(namespace)
238
+ val event: ScrollChanged = EventUtil.createScrollChangedEvent(argmap)
239
+ val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
240
+ event.entities.addAll(evCtxts)
241
+ trackerController.track(event)
242
+ promise.resolve(true)
243
+ } catch (t: Throwable) {
244
+ promise.reject("ERROR", t.message)
245
+ }
246
+ }
247
+
248
+ @ReactMethod
249
+ fun trackListItemViewEvent(
250
+ details: ReadableMap,
251
+ promise: Promise
252
+ ) {
253
+ try {
254
+ val namespace = details.getString("tracker")
255
+ val argmap = details.getMap("eventData")!!
256
+ val contexts = details.getArray("contexts")!!
257
+ val trackerController = getTracker(namespace)
258
+ val event: ListItemView = EventUtil.createListItemViewEvent(argmap)
259
+ val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
260
+ event.entities.addAll(evCtxts)
221
261
  trackerController.track(event)
222
262
  promise.resolve(true)
223
263
  } catch (t: Throwable) {
@@ -237,7 +277,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
237
277
  val trackerController = getTracker(namespace)
238
278
  val event: PageView = EventUtil.createPageViewEvent(argmap)
239
279
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
240
- event.customContexts.addAll(evCtxts)
280
+ event.entities.addAll(evCtxts)
241
281
  trackerController.track(event)
242
282
  promise.resolve(true)
243
283
  } catch (t: Throwable) {
@@ -257,7 +297,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
257
297
  val trackerController = getTracker(namespace)
258
298
  val event: Timing = EventUtil.createTimingEvent(argmap)
259
299
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
260
- event.customContexts.addAll(evCtxts)
300
+ event.entities.addAll(evCtxts)
261
301
  trackerController.track(event)
262
302
  promise.resolve(true)
263
303
  } catch (t: Throwable) {
@@ -277,7 +317,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
277
317
  val trackerController = getTracker(namespace)
278
318
  val event: ConsentGranted = EventUtil.createConsentGrantedEvent(argmap)
279
319
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
280
- event.customContexts.addAll(evCtxts)
320
+ event.entities.addAll(evCtxts)
281
321
  trackerController.track(event)
282
322
  promise.resolve(true)
283
323
  } catch (t: Throwable) {
@@ -297,7 +337,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
297
337
  val trackerController = getTracker(namespace)
298
338
  val event: ConsentWithdrawn = EventUtil.createConsentWithdrawnEvent(argmap)
299
339
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
300
- event.customContexts.addAll(evCtxts)
340
+ event.entities.addAll(evCtxts)
301
341
  trackerController.track(event)
302
342
  promise.resolve(true)
303
343
  } catch (t: Throwable) {
@@ -317,7 +357,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
317
357
  val trackerController = getTracker(namespace)
318
358
  val event: EcommerceTransaction = EventUtil.createEcommerceTransactionEvent(argmap)
319
359
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
320
- event.customContexts.addAll(evCtxts)
360
+ event.entities.addAll(evCtxts)
321
361
  trackerController.track(event)
322
362
  promise.resolve(true)
323
363
  } catch (t: Throwable) {
@@ -337,7 +377,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
337
377
  val trackerController = getTracker(namespace)
338
378
  val event: DeepLinkReceived = EventUtil.createDeepLinkReceivedEvent(argmap)
339
379
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
340
- event.customContexts.addAll(evCtxts)
380
+ event.entities.addAll(evCtxts)
341
381
  trackerController.track(event)
342
382
  promise.resolve(true)
343
383
  } catch (t: Throwable) {
@@ -357,7 +397,7 @@ class ReactNativeTrackerModule(val reactContext: ReactApplicationContext) :
357
397
  val trackerController = getTracker(namespace)
358
398
  val event: MessageNotification = EventUtil.createMessageNotificationEvent(argmap)
359
399
  val evCtxts: List<SelfDescribingJson> = EventUtil.createContexts(contexts)
360
- event.customContexts.addAll(evCtxts)
400
+ event.entities.addAll(evCtxts)
361
401
  trackerController.track(event)
362
402
  promise.resolve(true)
363
403
  } catch (t: Throwable) {
@@ -54,6 +54,9 @@ object ConfigUtil {
54
54
  if (trackerConfig.hasKey("screenViewAutotracking")) {
55
55
  trackerConfiguration.screenViewAutotracking(trackerConfig.getBoolean("screenViewAutotracking"))
56
56
  }
57
+ if (trackerConfig.hasKey("screenEngagementAutotracking")) {
58
+ trackerConfiguration.screenEngagementAutotracking(trackerConfig.getBoolean("screenEngagementAutotracking"))
59
+ }
57
60
  if (trackerConfig.hasKey("lifecycleAutotracking")) {
58
61
  trackerConfiguration.lifecycleAutotracking(trackerConfig.getBoolean("lifecycleAutotracking"))
59
62
  }
@@ -252,8 +255,8 @@ object ConfigUtil {
252
255
  private fun mkBufferOption(bufferOpt: String): BufferOption? {
253
256
  return when (bufferOpt) {
254
257
  "single" -> BufferOption.Single
255
- "default" -> BufferOption.DefaultGroup
256
- "large" -> BufferOption.HeavyGroup
258
+ "small" -> BufferOption.SmallGroup
259
+ "large" -> BufferOption.LargeGroup
257
260
  else -> null
258
261
  }
259
262
  }
@@ -50,6 +50,26 @@ object EventUtil {
50
50
  return event
51
51
  }
52
52
 
53
+ fun createScrollChangedEvent(argmap: ReadableMap): ScrollChanged {
54
+ val event = ScrollChanged(
55
+ yOffset = if (argmap.hasKey("yOffset")) { argmap.getDouble("yOffset").toInt() } else { null },
56
+ xOffset = if (argmap.hasKey("xOffset")) { argmap.getDouble("xOffset").toInt() } else { null },
57
+ viewHeight = if (argmap.hasKey("viewHeight")) { argmap.getDouble("viewHeight").toInt() } else { null },
58
+ viewWidth = if (argmap.hasKey("viewWidth")) { argmap.getDouble("viewWidth").toInt() } else { null },
59
+ contentHeight = if (argmap.hasKey("contentHeight")) { argmap.getDouble("contentHeight").toInt() } else { null },
60
+ contentWidth = if (argmap.hasKey("contentWidth")) { argmap.getDouble("contentWidth").toInt() } else { null },
61
+ )
62
+ return event
63
+ }
64
+
65
+ fun createListItemViewEvent(argmap: ReadableMap): ListItemView {
66
+ val event = ListItemView(
67
+ index = argmap.getDouble("index").toInt(),
68
+ itemsCount = if (argmap.hasKey("itemsCount")) { argmap.getDouble("itemsCount").toInt() } else { null },
69
+ )
70
+ return event
71
+ }
72
+
53
73
  fun createPageViewEvent(argmap: ReadableMap): PageView {
54
74
  val event = PageView(argmap.getString("pageUrl")!!)
55
75
  argmap.getString("pageTitle")?.let { event.pageTitle(it) }
@@ -1,5 +1,5 @@
1
1
  package com.snowplow.reactnativetracker.util
2
2
 
3
3
  object TrackerVersion {
4
- const val RN_TRACKER_VERSION = "rn-2.0.0"
4
+ const val RN_TRACKER_VERSION = "rn-2.1.1"
5
5
  }
package/example/Gemfile CHANGED
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
3
3
  # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
4
  ruby ">= 2.6.10"
5
5
 
6
- gem 'cocoapods', '~> 1.12'
6
+ gem 'cocoapods', '1.15.2'
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  const commands = require('./helpers/microCommands.js');
15
2
 
16
3
  describe('Example', () => {
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  const Micro = require('./microHelpers.js');
15
2
 
16
3
  const microUrl = '0.0.0.0';
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  const http = require('http');
15
2
 
16
3
  /**
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  const Micro = require('./microHelpers.js');
15
2
 
16
3
  describe('tests helper functions of helpers.js', () => {
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  // Self-describing schemas
15
2
  const appInstall =
16
3
  'iglu:com.snowplowanalytics.mobile/application_install/jsonschema/1-0-0';
@@ -1,16 +1,3 @@
1
- /*
2
- * Copyright (c) 2020-2023 Snowplow Analytics Ltd. All rights reserved.
3
- *
4
- * This program is licensed to you under the Apache License Version 2.0,
5
- * and you may not use this file except in compliance with the Apache License Version 2.0.
6
- * You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
7
- *
8
- * Unless required by applicable law or agreed to in writing,
9
- * software distributed under the Apache License Version 2.0 is distributed on an
10
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- * See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
12
- */
13
-
14
1
  const commands = require('./helpers/microCommands.js');
15
2
  const schemas = require('./helpers/schemas.js');
16
3
 
@@ -235,7 +222,7 @@ test('common in all first tracker events', async () => {
235
222
  },
236
223
  ],
237
224
  },
238
- 23
225
+ 29
239
226
  );
240
227
  });
241
228
 
@@ -60,5 +60,3 @@ target 'ReactNativeTrackerExample' do
60
60
  __apply_Xcode_12_5_M1_post_install_workaround(installer)
61
61
  end
62
62
  end
63
-
64
- pod 'FMDB', :modular_headers => true