@snowplow/react-native-tracker 1.3.0 → 2.0.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 (240) hide show
  1. package/.editorconfig +15 -0
  2. package/.eslintignore +6 -0
  3. package/.gitattributes +3 -0
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. package/.github/actions/setup/action.yml +28 -0
  7. package/.github/workflows/build.yml +150 -0
  8. package/.github/workflows/deploy.yml +98 -0
  9. package/.github/workflows/e2e-android.yml +121 -0
  10. package/.github/workflows/e2e-ios.yml +90 -0
  11. package/.github/workflows/snyk.yml +21 -0
  12. package/.gitignore +70 -0
  13. package/.npmignore +60 -0
  14. package/.nvmrc +1 -0
  15. package/.watchmanconfig +1 -0
  16. package/.yarnrc +3 -0
  17. package/CHANGELOG +166 -0
  18. package/CONTRIBUTING.md +80 -0
  19. package/LICENSE +1 -1
  20. package/README.md +24 -111
  21. package/android/build.gradle +93 -37
  22. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  23. package/android/gradle/wrapper/gradle-wrapper.properties +1 -2
  24. package/android/gradle.properties +5 -2
  25. package/android/gradlew +172 -110
  26. package/android/gradlew.bat +24 -19
  27. package/android/src/main/AndroidManifest.xml +1 -3
  28. package/android/src/main/AndroidManifestNew.xml +2 -0
  29. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +704 -0
  30. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +17 -0
  31. package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +271 -0
  32. package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +213 -0
  33. package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +5 -0
  34. package/babel.config.js +3 -0
  35. package/example/.watchmanconfig +1 -0
  36. package/example/Gemfile +6 -0
  37. package/example/android/app/build.gradle +129 -0
  38. package/example/android/app/debug.keystore +0 -0
  39. package/example/android/app/proguard-rules.pro +10 -0
  40. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +36 -0
  41. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +21 -0
  42. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  43. package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +75 -0
  44. package/example/android/app/src/main/AndroidManifest.xml +26 -0
  45. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +32 -0
  46. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +62 -0
  47. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  48. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  49. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  50. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  51. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  52. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  53. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  54. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  55. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  56. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  57. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  58. package/example/android/app/src/main/res/values/strings.xml +3 -0
  59. package/example/android/app/src/main/res/values/styles.xml +9 -0
  60. package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +20 -0
  61. package/example/android/build.gradle +31 -0
  62. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  63. package/example/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  64. package/example/android/gradle.properties +44 -0
  65. package/example/android/gradlew +244 -0
  66. package/example/android/gradlew.bat +92 -0
  67. package/example/android/settings.gradle +4 -0
  68. package/example/app.json +4 -0
  69. package/example/babel.config.js +17 -0
  70. package/example/detox.config.js +92 -0
  71. package/example/e2e/config.json +10 -0
  72. package/example/e2e/emitEvents.e2e.detox.js +108 -0
  73. package/example/e2e/environment.js +23 -0
  74. package/example/e2e/helpers/microCommands.js +153 -0
  75. package/example/e2e/helpers/microHelpers.js +346 -0
  76. package/example/e2e/helpers/microHelpers.test.js +308 -0
  77. package/example/e2e/helpers/schemas.js +62 -0
  78. package/example/e2e/jest.config.js +16 -0
  79. package/example/e2e/setup.js +4 -0
  80. package/example/e2e/testEvents.micro.test.js +300 -0
  81. package/example/index.js +5 -0
  82. package/example/ios/.xcode.env +11 -0
  83. package/example/ios/Podfile +64 -0
  84. package/example/ios/Podfile.lock +737 -0
  85. package/example/ios/ReactNativeTrackerExample/AppDelegate.h +6 -0
  86. package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +26 -0
  87. package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  88. package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +6 -0
  89. package/example/ios/ReactNativeTrackerExample/Info.plist +55 -0
  90. package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +47 -0
  91. package/example/ios/ReactNativeTrackerExample/main.m +10 -0
  92. package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +3 -0
  93. package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +722 -0
  94. package/{ios/RNSnowplowTracker.xcodeproj/xcshareddata/xcschemes/RNSnowplowTracker.xcscheme → example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme} +29 -21
  95. package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +10 -0
  96. package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  97. package/example/ios/ReactNativeTrackerExampleTests/Info.plist +24 -0
  98. package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +66 -0
  99. package/example/metro.config.js +45 -0
  100. package/example/package.json +54 -0
  101. package/example/react-native.config.js +10 -0
  102. package/example/src/App.js +557 -0
  103. package/example/tsconfig.json +5 -0
  104. package/example/yarn.lock +7379 -0
  105. package/ios/ReactNativeTracker-Bridging-Header.h +2 -0
  106. package/ios/ReactNativeTracker.mm +165 -0
  107. package/ios/ReactNativeTracker.swift +757 -0
  108. package/ios/{RNSnowplowTracker.xcodeproj → ReactNativeTracker.xcodeproj}/project.pbxproj +55 -79
  109. package/ios/Util/ConfigUtils.swift +206 -0
  110. package/ios/Util/TrackerVersion.swift +3 -0
  111. package/ios/Util/Utilities.swift +37 -0
  112. package/lefthook.yml +11 -0
  113. package/lib/commonjs/api.js +475 -0
  114. package/lib/commonjs/api.js.map +1 -0
  115. package/lib/commonjs/configurations.js +209 -0
  116. package/lib/commonjs/configurations.js.map +1 -0
  117. package/lib/commonjs/constants.js +85 -0
  118. package/lib/commonjs/constants.js.map +1 -0
  119. package/lib/commonjs/events.js +256 -0
  120. package/lib/commonjs/events.js.map +1 -0
  121. package/lib/commonjs/index.js +141 -0
  122. package/lib/commonjs/index.js.map +1 -0
  123. package/lib/commonjs/jsCore.js +393 -0
  124. package/lib/commonjs/jsCore.js.map +1 -0
  125. package/lib/commonjs/native.js +29 -0
  126. package/lib/commonjs/native.js.map +1 -0
  127. package/lib/commonjs/subject.js +248 -0
  128. package/lib/commonjs/subject.js.map +1 -0
  129. package/lib/commonjs/tracker.js +221 -0
  130. package/lib/commonjs/tracker.js.map +1 -0
  131. package/lib/commonjs/types.js +2 -0
  132. package/lib/commonjs/types.js.map +1 -0
  133. package/lib/commonjs/utils.js +85 -0
  134. package/lib/commonjs/utils.js.map +1 -0
  135. package/lib/commonjs/webViewInterface.js +79 -0
  136. package/lib/commonjs/webViewInterface.js.map +1 -0
  137. package/lib/module/api.js +439 -0
  138. package/lib/module/api.js.map +1 -0
  139. package/lib/module/configurations.js +197 -0
  140. package/lib/module/configurations.js.map +1 -0
  141. package/lib/module/constants.js +80 -0
  142. package/lib/module/constants.js.map +1 -0
  143. package/lib/module/events.js +240 -0
  144. package/lib/module/events.js.map +1 -0
  145. package/lib/module/index.js +129 -0
  146. package/lib/module/index.js.map +1 -0
  147. package/lib/module/jsCore.js +390 -0
  148. package/lib/module/jsCore.js.map +1 -0
  149. package/lib/module/native.js +25 -0
  150. package/lib/module/native.js.map +1 -0
  151. package/lib/module/subject.js +235 -0
  152. package/lib/module/subject.js.map +1 -0
  153. package/lib/module/tracker.js +209 -0
  154. package/lib/module/tracker.js.map +1 -0
  155. package/lib/module/types.js +2 -0
  156. package/lib/module/types.js.map +1 -0
  157. package/lib/module/utils.js +79 -0
  158. package/lib/module/utils.js.map +1 -0
  159. package/lib/module/webViewInterface.js +75 -0
  160. package/lib/module/webViewInterface.js.map +1 -0
  161. package/lib/typescript/__tests__/api.test.d.ts +2 -0
  162. package/lib/typescript/__tests__/api.test.d.ts.map +1 -0
  163. package/lib/typescript/__tests__/configurations.test.d.ts +2 -0
  164. package/lib/typescript/__tests__/configurations.test.d.ts.map +1 -0
  165. package/lib/typescript/__tests__/events.test.d.ts +2 -0
  166. package/lib/typescript/__tests__/events.test.d.ts.map +1 -0
  167. package/lib/typescript/__tests__/index.test.d.ts +2 -0
  168. package/lib/typescript/__tests__/index.test.d.ts.map +1 -0
  169. package/lib/typescript/__tests__/jsCore.test.d.ts +2 -0
  170. package/lib/typescript/__tests__/jsCore.test.d.ts.map +1 -0
  171. package/lib/typescript/__tests__/utils.test.d.ts +2 -0
  172. package/lib/typescript/__tests__/utils.test.d.ts.map +1 -0
  173. package/lib/typescript/api.d.ts +226 -0
  174. package/lib/typescript/api.d.ts.map +1 -0
  175. package/lib/typescript/configurations.d.ts +73 -0
  176. package/lib/typescript/configurations.d.ts.map +1 -0
  177. package/lib/typescript/constants.d.ts +59 -0
  178. package/lib/typescript/constants.d.ts.map +1 -0
  179. package/lib/typescript/events.d.ts +101 -0
  180. package/lib/typescript/events.d.ts.map +1 -0
  181. package/lib/typescript/index.d.ts +27 -0
  182. package/lib/typescript/index.d.ts.map +1 -0
  183. package/lib/typescript/jsCore.d.ts +140 -0
  184. package/lib/typescript/jsCore.d.ts.map +1 -0
  185. package/lib/typescript/native.d.ts +4 -0
  186. package/lib/typescript/native.d.ts.map +1 -0
  187. package/lib/typescript/subject.d.ts +91 -0
  188. package/lib/typescript/subject.d.ts.map +1 -0
  189. package/lib/typescript/tracker.d.ts +93 -0
  190. package/lib/typescript/tracker.d.ts.map +1 -0
  191. package/{dist/index.d.ts → lib/typescript/types.d.ts} +188 -75
  192. package/lib/typescript/types.d.ts.map +1 -0
  193. package/lib/typescript/utils.d.ts +35 -0
  194. package/lib/typescript/utils.d.ts.map +1 -0
  195. package/lib/typescript/webViewInterface.d.ts +15 -0
  196. package/lib/typescript/webViewInterface.d.ts.map +1 -0
  197. package/package.json +138 -51
  198. package/scripts/bootstrap.js +29 -0
  199. package/snowplow-react-native-tracker.podspec +42 -0
  200. package/src/__mocks__/react-native.js +7 -0
  201. package/src/__tests__/api.test.ts +34 -0
  202. package/src/__tests__/configurations.test.ts +620 -0
  203. package/src/__tests__/events.test.ts +749 -0
  204. package/src/__tests__/index.test.ts +27 -0
  205. package/src/__tests__/jsCore.test.ts +169 -0
  206. package/src/__tests__/utils.test.ts +23 -0
  207. package/src/api.ts +535 -0
  208. package/src/configurations.ts +337 -0
  209. package/src/constants.ts +102 -0
  210. package/src/events.ts +330 -0
  211. package/src/index.ts +189 -0
  212. package/src/jsCore.ts +553 -0
  213. package/src/native.ts +34 -0
  214. package/src/subject.ts +315 -0
  215. package/src/tracker.ts +330 -0
  216. package/src/types.ts +1087 -0
  217. package/src/utils.ts +78 -0
  218. package/src/webViewInterface.ts +105 -0
  219. package/tsconfig.build.json +5 -0
  220. package/tsconfig.json +28 -0
  221. package/turbo.json +34 -0
  222. package/yarn.lock +9333 -0
  223. package/RNSnowplowTracker.podspec +0 -24
  224. package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerModule.java +0 -750
  225. package/android/src/main/java/com/snowplowanalytics/react/tracker/RNSnowplowTrackerPackage.java +0 -29
  226. package/android/src/main/java/com/snowplowanalytics/react/util/ConfigUtil.java +0 -351
  227. package/android/src/main/java/com/snowplowanalytics/react/util/EventUtil.java +0 -339
  228. package/android/src/main/java/com/snowplowanalytics/react/util/TrackerVersion.java +0 -7
  229. package/dist/index.js +0 -1650
  230. package/dist/index.js.map +0 -1
  231. package/ios/RNSnowplowTracker.h +0 -34
  232. package/ios/RNSnowplowTracker.m +0 -911
  233. package/ios/Util/NSDictionary+RNSP_TypeMethods.h +0 -33
  234. package/ios/Util/NSDictionary+RNSP_TypeMethods.m +0 -40
  235. package/ios/Util/RNConfigUtils.h +0 -44
  236. package/ios/Util/RNConfigUtils.m +0 -209
  237. package/ios/Util/RNTrackerVersion.h +0 -27
  238. package/ios/Util/RNTrackerVersion.m +0 -27
  239. package/ios/Util/RNUtilities.h +0 -32
  240. package/ios/Util/RNUtilities.m +0 -68
package/.npmignore ADDED
@@ -0,0 +1,60 @@
1
+ # Demo app
2
+ #
3
+ example/
4
+
5
+ # Local testing workflow
6
+ #
7
+ .scripts/
8
+ tmp/
9
+
10
+ # OSX
11
+ #
12
+ .DS_Store
13
+
14
+ # node.js
15
+ #
16
+ node_modules/
17
+ npm-debug.log
18
+ yarn-error.log
19
+
20
+
21
+ # Xcode
22
+ #
23
+ build/
24
+ *.pbxuser
25
+ !default.pbxuser
26
+ *.mode1v3
27
+ !default.mode1v3
28
+ *.mode2v3
29
+ !default.mode2v3
30
+ *.perspectivev3
31
+ !default.perspectivev3
32
+ xcuserdata
33
+ *.xccheckout
34
+ *.moved-aside
35
+ DerivedData
36
+ *.hmap
37
+ *.ipa
38
+ *.xcuserstate
39
+ *.xcworkspace/
40
+
41
+ # CocoaPods
42
+ /ios/Pods/
43
+
44
+
45
+ # Android/IntelliJ
46
+ #
47
+ build/
48
+ .idea
49
+ .gradle
50
+ local.properties
51
+ *.iml
52
+ android/.project
53
+ android/.settings/org.eclipse.buildship.core.prefs
54
+ example/android/.settings/org.eclipse.buildship.core.prefs
55
+ example/android/.project
56
+
57
+ # BUCK
58
+ buck-out/
59
+ \.buckd/
60
+ *.keystore
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v18
@@ -0,0 +1 @@
1
+ {}
package/.yarnrc ADDED
@@ -0,0 +1,3 @@
1
+ # Override Yarn command so we can automatically setup the repo on running `yarn`
2
+
3
+ yarn-path "scripts/bootstrap.js"
package/CHANGELOG ADDED
@@ -0,0 +1,166 @@
1
+ Version 2.0.0 (2023-09-29)
2
+ --------------------------
3
+ Upgrade project structure and update native trackers to version 5 (#199)
4
+ Disable automatic screen view tracking in the iOS and Android tracker by default (#198)
5
+ Fix buffer option in emitter configuration on Android to set correct value for large setting (#197)
6
+
7
+ Version 1.4.0 (2022-02-04)
8
+ --------------------------
9
+ Add JavaScript tracker core to be used in Expo managed workflow when native trackers are not available (#188)
10
+ Bump Snowplow native tracker dependency to 4.1 (#186)
11
+ Update year in copyright headers to 2023 (#187)
12
+
13
+ Version 1.3.0 (2022-10-03)
14
+ --------------------------
15
+ Upgrade Snowplow mobile trackers to v4 (#167)
16
+ Add anonymous tracking features (#168)
17
+ Add interface to subscribe for events tracked in Web views (#169)
18
+ Add option to add custom headers (#165)
19
+ Enable setting custom path for POST requests (#178)
20
+ Upgrade internal and demo app dependencies (#172)
21
+ Remove circular imports of demo app dependencies when running in demo apps (#174)
22
+
23
+ Version 1.2.1 (2022-04-12)
24
+ --------------------------
25
+ Fix import of non-published NSDictionary helpers from SnowplowTracker on iOS (#161)
26
+
27
+ Version 1.2.0 (2022-03-25)
28
+ --------------------------
29
+ Add support for React Native for tvOS (#154)
30
+ Bump min RN version supported to v0.65+ (#153)
31
+ Add generic type for SelfDescribing event data (#156)
32
+
33
+ Version 1.1.0 (2022-02-07)
34
+ --------------------------
35
+ Update mobile tracker dependencies to v3 (#141)
36
+ Add deep link and message notification events (#142)
37
+ Update demo app to show accessing tracker instance from platform native code (#136)
38
+ Fix compilation error for iOS build on ARM macs (#140)
39
+ Fix check for byteLimitGet when reading emitter configuration (#138)
40
+ Fix check for Android version in GitHub Actions (#134)
41
+ Update year in all copyright notices (#148)
42
+ Update dependencies (#150)
43
+
44
+ Version 1.0.0 (2021-08-09)
45
+ --------------------------
46
+ Fix action-gh-release to specific commit (#133)
47
+ Update devDependencies (#132)
48
+ Publish sourcemaps (#131)
49
+ Lint DemoApp separately (#130)
50
+ Get Session Context Data (#53)
51
+ Update version in podspec (#110)
52
+ Set amended v_tracker indicating react-native (#18)
53
+ Add global contexts (#104)
54
+ Upgrade iOS Tracker and Android Tracker to v2 (#113)
55
+ Add test suite (#60)
56
+
57
+ Version 0.2.0 (2021-06-21)
58
+ --------------------------
59
+ Bump dependencies in DemoApp (#114)
60
+ Port to TypeScript (#115)
61
+ Handle asyncronous issues internally (#78)
62
+ Use ESLint (#126)
63
+ Add homepage and repository in package.json (#125)
64
+ Remove unused files (#124)
65
+
66
+ Version 0.1.7 (2021-05-24)
67
+ --------------------------
68
+ Remove waitForEventStore method and upgrade Android tracker (#92)
69
+ Automate deploy process (#61)
70
+ Fix null transitionType resulting in screen view event failing validation for ios (#122)
71
+ Fix Xcode 12.5 build breaks (#119)
72
+ Fix typo in CHANGELOG (#116)
73
+ Remove JCenter and add MavenCentral (#121)
74
+ Update build.gradle to match rootProject extra properties (#120)
75
+ Fix assembleAndroidTest builds (#118)
76
+
77
+ Version 0.1.6 (2021-04-06)
78
+ --------------------------
79
+ Bump iOS Tracker to 1.7.0 (#111)
80
+
81
+ Version 0.1.5 (2021-03-22)
82
+ --------------------------
83
+ Update DemoApp versions (#106)
84
+ Loosen peer dependency requirements (#105)
85
+
86
+ Note: v0.1.4 was skipped due to an error in publishing process.
87
+ ---------------------------------------------------------------
88
+
89
+ Version 0.1.3 (2021-02-12)
90
+ --------------------------
91
+ Fix Xcode 12 compatibility (#102)
92
+
93
+ Version 0.1.2 (2021-01-15)
94
+ --------------------------
95
+ Upgrade obj-c tracker to 1.6.2 (#98)
96
+
97
+ Version 0.1.1 (2020-09-03)
98
+ --------------------------
99
+ Fix Android tracker version to 1.5.x (#91)
100
+
101
+ Version 0.1.0 (2020-07-10)
102
+ --------------------------
103
+ Add issue templates (#89)
104
+ Add CONTRIBUTING.md (#80)
105
+ Use recommended config as defaults (#86)
106
+ Fix iOS null comparison warnings (#85)
107
+ Return after promise rejection on Android (#84)
108
+ Update arguments and var names for consistency (#83)
109
+ Update DemoApp (#82)
110
+ Use fast fail on iOS (#87)
111
+ Update README (#77)
112
+ Dynamically use latest minor version of native tracker (#19)
113
+ Cleanup code formatting (#75)
114
+ Add Snyk Github Action (#71)
115
+ Add license (#62)
116
+ Handle setSubjectData values appropriately (#70)
117
+ Return promise on intialize() (#66)
118
+ Remove deprecated options (#69)
119
+ Expand testing scripts (#72)
120
+ Refactor method instrumentation (#58)
121
+ Fix compile warnings caused by unsafe comparison (#73)
122
+ Fix double self calls (#74)
123
+ Remove screen_id workaround (#57)
124
+
125
+ Version 0.1.0-alpha.17 (2020-05-04)
126
+ -----------------------------------
127
+ Use yarn everywhere for testing (#55)
128
+ Update ios tracker version to 1.3.0 (#54)
129
+
130
+ Version 0.1.0-alpha.16 (2020-04-16)
131
+ -----------------------------------
132
+ Update .npmignore and .gitignore (#51)
133
+ Update README (#50)
134
+ Update Demo App (#48)
135
+ Add trackPageView (#33)
136
+ Add script for clean build (#47)
137
+ Add setSubjectData method (#46)
138
+ Update android tracker version (#45)
139
+ Add Standard Settings (#34)
140
+
141
+ Version 0.1.0-alpha.15 (2020-02-06)
142
+ -----------------------------------
143
+ Cleanup Repo (#29)
144
+ Update DemoApp (#21)
145
+ Update ios Tracker dependency to remove mandatory dynamic build (#22)
146
+
147
+ Version 0.1.0-alpha.14 (2019-10-22)
148
+ ----------------------------------
149
+ Update iOS to incorporate patch release (#23)
150
+
151
+ Version 0.1.0-alpha.13 (2019-10-14)
152
+ -----------------------------------
153
+ Make optional StructEvent parameters nullable for iOS (#12)
154
+ Add ScreenViews (#14)
155
+ Fix bug in android getContexts (#16)
156
+ Add mobile context (#13)
157
+ Update README.md (#5)
158
+ Fix path in Android package export (#8)
159
+ Fix high severity vulnerabilities in DemoApp (#7)
160
+ Bump DemoApp react-native version (#6)
161
+ Fix import in Demo Application (#3)
162
+ Fix Android Numeric type bug (#4)
163
+
164
+ Version 0.1.0-alpha.9 (2019-08-08)
165
+ ----------------------------------
166
+ Initial Release
@@ -0,0 +1,80 @@
1
+ # Contributing
2
+
3
+ The Snowplow React Native Tracker is maintained by the Engineering team at Snowplow Analytics. We welcome suggestions for improvements and bug fixes to all Snowplow Trackers.
4
+
5
+ We are extremely grateful for all contributions we receive, whether that is reporting an issue or a change to the code which can be made in the form of a pull request.
6
+
7
+ For support requests, please use our community support Discourse forum: https://discourse.snowplowanalytics.com/.
8
+
9
+ ## Setting up an Environment
10
+
11
+ Instructions on how to build and run tests are available in the [README.md](README.md). The README will also list any requirements that you will need to install first before being able to build and run the tests.
12
+
13
+ You should ensure you are comfortable building and testing the existing release before adding new functionality or fixing issues.
14
+
15
+ ## Issues
16
+
17
+ ### Creating an issue
18
+
19
+ The project contains an issue template which should help guiding you through the process. However, please keep in mind that support requests should go to our Discourse forum: https://discourse.snowplowanalytics.com/ and not GitHub issues.
20
+
21
+ It's also a good idea to log an issue before starting to work on a pull request to discuss it with the maintainers. A pull request is just one solution to a problem and it is often a good idea to talk about the problem with the maintainers first.
22
+
23
+ ### Working on an issue
24
+
25
+ If you see an issue you would like to work on, please let us know in the issue! That will help us in terms of scheduling and
26
+ not doubling the amount of work.
27
+
28
+ If you don't know where to start contributing, you can look at
29
+ [the issues labeled `good first issue`](https://github.com/snowplow-incubator/snowplow-react-native-tracker/labels/good%20first%20issue).
30
+
31
+ ## Pull requests
32
+
33
+ These are a few guidelines to keep in mind when opening pull requests.
34
+
35
+ ### Guidelines
36
+
37
+ Please supply a good PR description. These are very helpful and help the maintainers to understand _why_ the change has been made, not just _what_ changes have been made.
38
+
39
+ Please try and keep your PR to a single feature of fix. This might mean breaking up a feature into multiple PRs but this makes it easier for the maintainers to review and also reduces the risk in each change.
40
+
41
+ Please review your own PR as you would do it you were a reviewer first. This is a great way to spot any mistakes you made when writing the change. Additionally, ensure your code compiles and all tests pass.
42
+
43
+ ### Commit hygiene
44
+
45
+ We keep a strict 1-to-1 correspondance between commits and issues, as such our commit messages are formatted in the following
46
+ fashion:
47
+
48
+ `Issue Description (closes #1234)`
49
+
50
+ for example:
51
+
52
+ `Fix Issue with Tracker (closes #1234)`
53
+
54
+ ### Writing tests
55
+
56
+ Whenever necessary, it's good practice to add the corresponding tests to whichever feature you are working on.
57
+ Any non-trivial PR must have tests and will not be accepted without them.
58
+
59
+ ### Feedback cycle
60
+
61
+ Reviews should happen fairly quickly during weekdays.
62
+ If you feel your pull request has been forgotten, please ping one or more maintainers in the pull request.
63
+
64
+ ### Getting your pull request merged
65
+
66
+ If your pull request is fairly chunky, there might be a non-trivial delay between the moment the pull request is approved and the moment it gets merged. This is because your pull request will have been scheduled for a specific milestone which might or might not be actively worked on by a maintainer at the moment.
67
+
68
+ ### Contributor license agreement
69
+
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).
72
+ The @snowplowcla bot will guide you through the process.
73
+
74
+ ## Getting in touch
75
+
76
+ ### Community support requests
77
+
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
+
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-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
@@ -1,4 +1,3 @@
1
-
2
1
  # @snowplow/react-native-tracker
3
2
 
4
3
  [![actively-maintained]][tracker-classification]
@@ -9,28 +8,31 @@
9
8
  [![RN version][react-native-v-image]][react-native-v]
10
9
  [![downloads][downloads-dm-image]][downloads-dm]
11
10
 
12
-
13
11
  Snowplow is a scalable open-source platform for rich, high quality, low-latency data collection. It is designed to collect high quality, complete behavioral data for enterprise business.
14
12
 
15
13
  **To find out more, please check out the [Snowplow website][website] and our [documentation][docs].**
16
14
 
17
-
18
15
  ## Snowplow React-Native Tracker Overview
19
16
 
20
17
  The Snowplow React Native Tracker allows you to add analytics to your React Native apps when using a [Snowplow][snowplow] pipeline.
21
18
 
22
19
  With this library you can collect granular event-level data as your users interact with your React Native applications. It is build on top of Snowplow's [Mobile Native][native-trackers] [iOS][objc-tracker] and [Android][android-tracker] Trackers, in order to support the full range of out-of-the-box Snowplow events and tracking capabilities.
23
20
 
24
-
25
21
  ## Quick start
26
22
 
27
23
  From the root of your [React Native][react-native] project:
28
24
 
29
- ```
25
+ ```sh
30
26
  npm install --save @snowplow/react-native-tracker
31
27
  npx pod-install
32
28
  ```
33
29
 
30
+ In your `ios/Podfile` file (unless using Expo Go), please add the `FMDB` dependency with `modular_headers` set to `true`. This is necessary to make the `FMDB` package generate module maps so that it can be used by the tracker:
31
+
32
+ ```rb
33
+ pod 'FMDB', :modular_headers => true
34
+ ```
35
+
34
36
  Then, instrument the tracker in your app and start tracking events. For example:
35
37
 
36
38
  ```javascript
@@ -48,7 +50,6 @@ The Snowplow React Native Tracker also provides first-class support for TypeScri
48
50
 
49
51
  See also our [DemoApp][demoapp] for an example implementation.
50
52
 
51
-
52
53
  ## Find out more
53
54
 
54
55
  | Technical Docs | Setup Guide |
@@ -56,135 +57,50 @@ See also our [DemoApp][demoapp] for an example implementation.
56
57
  | [![i1][techdocs-image]][techdocs] | [![i2][setup-image]][setup] |
57
58
  | [Technical Docs][techdocs] | [Setup Guide][setup] |
58
59
 
59
-
60
-
61
60
  ## Maintainer quick start
62
61
 
63
- ### Launching the DemoApp
64
-
65
62
  Assuming a [react-native environment][react-native-environment] is set up, from the root of the repository:
66
63
 
67
64
  ```bash
68
- npm install
69
- npm run bootstrap
70
- cd DemoApp
71
- ```
72
-
73
- Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoApp/App.js`.
74
-
75
- **For Android:**
76
-
77
- ```bash
78
- yarn android
79
- ```
80
- _Note_: Linux users who want to run the DemoApp for Android, would also need to run `yarn start` in a separate terminal.
81
-
82
- **For iOS:**
83
-
84
- ```bash
85
- yarn pods && yarn ios
65
+ yarn
86
66
  ```
87
67
 
88
- During development, to quickly test changes, the `.scripts/quickTest.sh` bash script can be used.
68
+ ### Unit tests
89
69
 
90
- ```bash
91
- # android
92
- bash .scripts/quickTest.sh android
93
- # ios
94
- bash .scripts/quickTest.sh ios
95
- # both
96
- bash .scripts/quickTest.sh both
97
- ```
70
+ To run the unit tests, simply execute:
98
71
 
99
- Similarly, the `.scripts/cleanBuildAndRun.sh` script offers a naive way to clean-rebuild the entire project with your changes.
100
-
101
- ```bash
102
- # android
103
- bash .scripts/cleanBuildAndRun.sh android
104
- # ios
105
- bash .scripts/cleanBuildAndRun.sh ios
106
- # both
107
- bash .scripts/cleanBuildAndRun.sh both
72
+ ```sh
73
+ yarn test
108
74
  ```
109
75
 
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
- ```
76
+ ### Launching the example app
120
77
 
121
- Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoAppTV/App.js`.
78
+ Replace "placeholder" with the URI for your Snowplow Mini or other Snowplow collector in `DemoApp/App.js`.
122
79
 
123
- **For Android TV:**
80
+ **For Android:**
124
81
 
125
82
  ```bash
126
- yarn android
83
+ yarn example android
127
84
  ```
128
-
129
85
  _Note_: Linux users who want to run the DemoApp for Android, would also need to run `yarn start` in a separate terminal.
130
86
 
131
- **For tvOS:**
87
+ **For iOS:**
132
88
 
133
89
  ```bash
134
- yarn pods && yarn tvos
90
+ yarn example ios
135
91
  ```
136
92
 
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`.
138
-
139
93
  ### End-to-end tests
140
94
 
141
95
  Snowplow React-Native Tracker is being end-to-end tested using [Snowplow Micro][snowplow-micro] and [Detox][detox]. To run these tests locally:
142
96
 
143
- #### Prerequisites
144
-
145
- 1. **Docker**: Used to launch Snowplow Micro and expose its collector endpoint on `http://0.0.0.0:9090`.
146
- 2. **Perl**: Used to substitute the endpoint placeholders in `DemoApp/App.js` with Micro's endpoint for respective emulator/simulator.
147
- 3. **Detox** platform-specific development environment setup:
148
- - [For Android][detox-android-env]. Namely:
149
- - Java 8
150
- - Android SDK
151
- - Android Open-Source Project emulator
152
- - [For iOS][detox-ios-env]. Namely:
153
- - applesimutils
154
-
155
97
  #### Testing
156
98
 
157
- Once the prerequisites are in place:
158
-
159
- ```
160
- npm install
161
- npm run bootstrap
162
- cd DemoApp
163
- ```
164
-
165
- - **e2e-android**
166
- ```
167
- yarn e2e:android:micro
168
- ```
169
-
170
- - **e2e-ios**
171
- ```
172
- yarn e2e:ios:micro
173
- ```
174
-
175
- The above commands will take care to kill Micro's running container before exiting. If you'd prefer to keep Micro running in order to inspect the tracked events through Micro's REST API, you can alternatively control Micro through:
176
-
177
- ```
178
- yarn micro:run
179
- yarn micro:stop
180
- ```
181
- and run the e2e-tests on their own:
182
- ```
183
- yarn e2e:android
184
- # or
185
- yarn e2e:ios
186
- ```
187
-
99
+ 1. Start your [Snowplow Micro][snowplow-micro] instance locally.
100
+ 2. Replace the `placeholder` value for the `collectorEndpoint` variable in `example/src/App.js` (use the network IP address of your computer or ngrok).
101
+ 3. Start the end-to-end tests:
102
+ * On Android, run `yarn e2e:android`
103
+ * On iOS, run `yarn e2e:ios`
188
104
 
189
105
  ## Contributing
190
106
 
@@ -195,11 +111,9 @@ Feedback and contributions are welcome - if you have identified a bug, please lo
195
111
  | [![i3][contributing-image]][contributing] |
196
112
  | [Contributing][contributing] |
197
113
 
198
-
199
-
200
114
  ## Copyright and license
201
115
 
202
- The Snowplow React Native Tracker is copyright 2020-2022 Snowplow Analytics Ltd, 2019 DataCamp.
116
+ The Snowplow React Native Tracker is copyright 2020-2023 Snowplow Analytics Ltd, 2019 DataCamp.
203
117
 
204
118
  Licensed under the **[Apache License, Version 2.0][license]** (the "License");
205
119
  you may not use this software except in compliance with the License.
@@ -210,7 +124,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
210
124
  See the License for the specific language governing permissions and
211
125
  limitations under the License.
212
126
 
213
-
214
127
  [tracker-classification]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/tracker-maintenance-classification/
215
128
  [actively-maintained]: https://img.shields.io/static/v1?style=flat&label=Snowplow&message=Actively%20Maintained&color=6638b8&labelColor=9ba0aa&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAeFBMVEVMaXGXANeYANeXANZbAJmXANeUANSQAM+XANeMAMpaAJhZAJeZANiXANaXANaOAM2WANVnAKWXANZ9ALtmAKVaAJmXANZaAJlXAJZdAJxaAJlZAJdbAJlbAJmQAM+UANKZANhhAJ+EAL+BAL9oAKZnAKVjAKF1ALNBd8J1AAAAKHRSTlMAa1hWXyteBTQJIEwRgUh2JjJon21wcBgNfmc+JlOBQjwezWF2l5dXzkW3/wAAAHpJREFUeNokhQOCA1EAxTL85hi7dXv/E5YPCYBq5DeN4pcqV1XbtW/xTVMIMAZE0cBHEaZhBmIQwCFofeprPUHqjmD/+7peztd62dWQRkvrQayXkn01f/gWp2CrxfjY7rcZ5V7DEMDQgmEozFpZqLUYDsNwOqbnMLwPAJEwCopZxKttAAAAAElFTkSuQmCC
216
129
  [gh-actions]: https://github.com/snowplow-incubator/snowplow-react-native-tracker/actions