@snowplow/react-native-tracker 2.0.0 → 2.1.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.
Files changed (111) 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 +1 -1
  4. package/.github/workflows/e2e-ios.yml +5 -0
  5. package/.github/workflows/snyk.yml +1 -1
  6. package/CHANGELOG +10 -0
  7. package/CONTRIBUTING.md +2 -2
  8. package/LICENSE +1 -1
  9. package/README.md +1 -1
  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 +7 -14
  24. package/example/src/App.js +9 -0
  25. package/ios/ReactNativeTracker.mm +10 -0
  26. package/ios/ReactNativeTracker.swift +71 -6
  27. package/ios/Util/ConfigUtils.swift +5 -2
  28. package/ios/Util/TrackerVersion.swift +1 -1
  29. package/lib/commonjs/api.js +28 -13
  30. package/lib/commonjs/api.js.map +1 -1
  31. package/lib/commonjs/configurations.js +1 -14
  32. package/lib/commonjs/configurations.js.map +1 -1
  33. package/lib/commonjs/constants.js +6 -14
  34. package/lib/commonjs/constants.js.map +1 -1
  35. package/lib/commonjs/events.js +34 -13
  36. package/lib/commonjs/events.js.map +1 -1
  37. package/lib/commonjs/index.js +4 -13
  38. package/lib/commonjs/index.js.map +1 -1
  39. package/lib/commonjs/jsCore.js +49 -15
  40. package/lib/commonjs/jsCore.js.map +1 -1
  41. package/lib/commonjs/native.js +0 -13
  42. package/lib/commonjs/native.js.map +1 -1
  43. package/lib/commonjs/subject.js +0 -13
  44. package/lib/commonjs/subject.js.map +1 -1
  45. package/lib/commonjs/tracker.js +40 -13
  46. package/lib/commonjs/tracker.js.map +1 -1
  47. package/lib/commonjs/utils.js +0 -13
  48. package/lib/commonjs/utils.js.map +1 -1
  49. package/lib/commonjs/webViewInterface.js +0 -13
  50. package/lib/commonjs/webViewInterface.js.map +1 -1
  51. package/lib/module/api.js +27 -14
  52. package/lib/module/api.js.map +1 -1
  53. package/lib/module/configurations.js +1 -14
  54. package/lib/module/configurations.js.map +1 -1
  55. package/lib/module/constants.js +6 -14
  56. package/lib/module/constants.js.map +1 -1
  57. package/lib/module/events.js +33 -14
  58. package/lib/module/events.js.map +1 -1
  59. package/lib/module/index.js +4 -13
  60. package/lib/module/index.js.map +1 -1
  61. package/lib/module/jsCore.js +49 -15
  62. package/lib/module/jsCore.js.map +1 -1
  63. package/lib/module/native.js +0 -13
  64. package/lib/module/native.js.map +1 -1
  65. package/lib/module/subject.js +0 -13
  66. package/lib/module/subject.js.map +1 -1
  67. package/lib/module/tracker.js +40 -15
  68. package/lib/module/tracker.js.map +1 -1
  69. package/lib/module/utils.js +0 -13
  70. package/lib/module/utils.js.map +1 -1
  71. package/lib/module/webViewInterface.js +0 -13
  72. package/lib/module/webViewInterface.js.map +1 -1
  73. package/lib/typescript/api.d.ts +16 -2
  74. package/lib/typescript/api.d.ts.map +1 -1
  75. package/lib/typescript/configurations.d.ts.map +1 -1
  76. package/lib/typescript/constants.d.ts +5 -0
  77. package/lib/typescript/constants.d.ts.map +1 -1
  78. package/lib/typescript/events.d.ts +16 -2
  79. package/lib/typescript/events.d.ts.map +1 -1
  80. package/lib/typescript/index.d.ts.map +1 -1
  81. package/lib/typescript/jsCore.d.ts +13 -1
  82. package/lib/typescript/jsCore.d.ts.map +1 -1
  83. package/lib/typescript/native.d.ts.map +1 -1
  84. package/lib/typescript/subject.d.ts.map +1 -1
  85. package/lib/typescript/tracker.d.ts +20 -2
  86. package/lib/typescript/tracker.d.ts.map +1 -1
  87. package/lib/typescript/types.d.ts +83 -5
  88. package/lib/typescript/types.d.ts.map +1 -1
  89. package/lib/typescript/utils.d.ts.map +1 -1
  90. package/lib/typescript/webViewInterface.d.ts.map +1 -1
  91. package/package.json +3 -3
  92. package/snowplow-react-native-tracker.podspec +1 -1
  93. package/src/__tests__/api.test.ts +0 -13
  94. package/src/__tests__/configurations.test.ts +3 -15
  95. package/src/__tests__/events.test.ts +0 -13
  96. package/src/__tests__/index.test.ts +0 -13
  97. package/src/__tests__/jsCore.test.ts +43 -13
  98. package/src/__tests__/utils.test.ts +0 -13
  99. package/src/api.ts +34 -13
  100. package/src/configurations.ts +1 -13
  101. package/src/constants.ts +8 -13
  102. package/src/events.ts +38 -13
  103. package/src/index.ts +8 -13
  104. package/src/jsCore.ts +65 -15
  105. package/src/native.ts +0 -13
  106. package/src/subject.ts +0 -13
  107. package/src/tracker.ts +60 -13
  108. package/src/types.ts +93 -18
  109. package/src/utils.ts +0 -13
  110. package/src/webViewInterface.ts +0 -13
  111. package/yarn.lock +4 -4
@@ -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
@@ -12,7 +12,7 @@ jobs:
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
@@ -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,13 @@
1
+ Version 2.1.0 (2024-02-21)
2
+ --------------------------
3
+ Upgrade to mobile trackers version 6 and add screen engagement tracking (close #90)
4
+ Fix SelfDescribing extension type (close #204)
5
+ Update JavaScript tracker core version to 3.21.0
6
+ Fix running deploy action only on new tags
7
+ Update cocoapods version
8
+ Lock yarn version to 1.22.19
9
+ Update copyright headers
10
+
1
11
  Version 2.0.0 (2023-09-29)
2
12
  --------------------------
3
13
  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
@@ -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.0"
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
@@ -68,9 +68,6 @@ PODS:
68
68
  - FlipperKit/SKIOSNetworkPlugin (0.182.0):
69
69
  - FlipperKit/Core
70
70
  - FlipperKit/FlipperKitNetworkPlugin
71
- - FMDB (2.7.5):
72
- - FMDB/standard (= 2.7.5)
73
- - FMDB/standard (2.7.5)
74
71
  - fmt (6.2.1)
75
72
  - glog (0.3.5)
76
73
  - hermes-engine (0.72.4):
@@ -490,12 +487,11 @@ PODS:
490
487
  - React-jsi (= 0.72.4)
491
488
  - React-logger (= 0.72.4)
492
489
  - React-perflogger (= 0.72.4)
493
- - snowplow-react-native-tracker (2.0.0):
490
+ - snowplow-react-native-tracker (2.1.0):
494
491
  - RCT-Folly (= 2021.07.22.00)
495
492
  - React-Core
496
- - SnowplowTracker (~> 5.4)
497
- - SnowplowTracker (5.4.2):
498
- - FMDB (~> 2.7)
493
+ - SnowplowTracker (~> 6.0)
494
+ - SnowplowTracker (6.0.1)
499
495
  - SocketRocket (0.6.1)
500
496
  - Yoga (1.14.0)
501
497
  - YogaKit (1.18.1):
@@ -526,7 +522,6 @@ DEPENDENCIES:
526
522
  - FlipperKit/FlipperKitReactPlugin (= 0.182.0)
527
523
  - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.182.0)
528
524
  - FlipperKit/SKIOSNetworkPlugin (= 0.182.0)
529
- - FMDB
530
525
  - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
531
526
  - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
532
527
  - libevent (~> 2.1.12)
@@ -580,7 +575,6 @@ SPEC REPOS:
580
575
  - Flipper-Glog
581
576
  - Flipper-PeerTalk
582
577
  - FlipperKit
583
- - FMDB
584
578
  - fmt
585
579
  - libevent
586
580
  - OpenSSL-Universal
@@ -687,7 +681,6 @@ SPEC CHECKSUMS:
687
681
  Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
688
682
  Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
689
683
  FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6
690
- FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
691
684
  fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
692
685
  glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
693
686
  hermes-engine: 81191603c4eaa01f5e4ae5737a9efcf64756c7b2
@@ -726,12 +719,12 @@ SPEC CHECKSUMS:
726
719
  React-runtimescheduler: 4941cc1b3cf08b792fbf666342c9fc95f1969035
727
720
  React-utils: b79f2411931f9d3ea5781404dcbb2fa8a837e13a
728
721
  ReactCommon: 4b2bdcb50a3543e1c2b2849ad44533686610826d
729
- snowplow-react-native-tracker: e0acb614d407ecd3670d758085bb01b4029723c8
730
- SnowplowTracker: f954f5fe985411819ccdadd50ce142b7ad17efe2
722
+ snowplow-react-native-tracker: 609373a8a5e45b4b1fc42945763994180804969e
723
+ SnowplowTracker: 6b19c331d5b765bda8b97b1c70ab52491524da60
731
724
  SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
732
725
  Yoga: 3efc43e0d48686ce2e8c60f99d4e6bd349aff981
733
726
  YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
734
727
 
735
- PODFILE CHECKSUM: 29cd18006247e70f8bfa782a3bf063fcdb99d7db
728
+ PODFILE CHECKSUM: 3b739a495d6e28fa9459a36ce75470840caf7c79
736
729
 
737
- COCOAPODS: 1.12.0
730
+ COCOAPODS: 1.15.2
@@ -155,6 +155,15 @@ const App = () => {
155
155
 
156
156
  const onPressTrackScreenViewEvent = () => {
157
157
  tracker.trackScreenViewEvent({ name: 'onlyRequired' });
158
+ tracker.trackScrollChangedEvent({
159
+ yOffset: 20,
160
+ contentHeight: 100,
161
+ viewHeight: 50,
162
+ });
163
+ tracker.trackListItemViewEvent({
164
+ index: 1,
165
+ itemsCount: 10,
166
+ });
158
167
  tracker.trackScreenViewEvent({
159
168
  name: 'allPopulated',
160
169
  type: 'allPopulated',
@@ -32,6 +32,16 @@ RCT_EXTERN_METHOD(trackScreenViewEvent:
32
32
  resolver:(RCTPromiseResolveBlock)resolve
33
33
  rejecter:(RCTPromiseRejectBlock)reject)
34
34
 
35
+ RCT_EXTERN_METHOD(trackScrollChangedEvent:
36
+ (NSDictionary *)details
37
+ resolver:(RCTPromiseResolveBlock)resolve
38
+ rejecter:(RCTPromiseRejectBlock)reject)
39
+
40
+ RCT_EXTERN_METHOD(trackListItemViewEvent:
41
+ (NSDictionary *)details
42
+ resolver:(RCTPromiseResolveBlock)resolve
43
+ rejecter:(RCTPromiseRejectBlock)reject)
44
+
35
45
  RCT_EXTERN_METHOD(trackPageViewEvent:
36
46
  (NSDictionary *)details
37
47
  resolver:(RCTPromiseResolveBlock)resolve