mixpanel-react-native 1.3.4 → 1.3.5

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 (211) hide show
  1. package/.github/workflows/node.js.yml +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/MixpanelReactNative.podspec +1 -1
  4. package/README.md +2 -1
  5. package/Samples/ContextAPIMixpanel/.buckconfig +6 -0
  6. package/Samples/ContextAPIMixpanel/.editorconfig +3 -0
  7. package/Samples/ContextAPIMixpanel/.eslintrc.js +4 -0
  8. package/Samples/ContextAPIMixpanel/.flowconfig +66 -0
  9. package/Samples/ContextAPIMixpanel/.gitattributes +3 -0
  10. package/Samples/ContextAPIMixpanel/.prettierrc.js +7 -0
  11. package/Samples/ContextAPIMixpanel/.watchmanconfig +1 -0
  12. package/Samples/ContextAPIMixpanel/Analytics.js +18 -0
  13. package/Samples/ContextAPIMixpanel/App.js +17 -0
  14. package/Samples/ContextAPIMixpanel/Screens/SampleScreen.js +17 -0
  15. package/Samples/ContextAPIMixpanel/__tests__/App-test.js +14 -0
  16. package/Samples/ContextAPIMixpanel/android/.project +28 -0
  17. package/Samples/ContextAPIMixpanel/android/app/BUCK +55 -0
  18. package/Samples/ContextAPIMixpanel/android/app/build.gradle +222 -0
  19. package/Samples/ContextAPIMixpanel/android/app/build_defs.bzl +19 -0
  20. package/Samples/ContextAPIMixpanel/android/app/debug.keystore +0 -0
  21. package/Samples/ContextAPIMixpanel/android/app/proguard-rules.pro +10 -0
  22. package/Samples/ContextAPIMixpanel/android/app/src/debug/AndroidManifest.xml +13 -0
  23. package/Samples/ContextAPIMixpanel/android/app/src/debug/java/com/contextapimixpanel/ReactNativeFlipper.java +72 -0
  24. package/Samples/ContextAPIMixpanel/android/app/src/main/AndroidManifest.xml +25 -0
  25. package/Samples/ContextAPIMixpanel/android/app/src/main/java/com/contextapimixpanel/MainActivity.java +15 -0
  26. package/Samples/ContextAPIMixpanel/android/app/src/main/java/com/contextapimixpanel/MainApplication.java +80 -0
  27. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  28. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  29. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  30. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  31. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  32. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  33. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  34. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  35. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  36. package/Samples/ContextAPIMixpanel/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  37. package/Samples/ContextAPIMixpanel/android/app/src/main/res/values/strings.xml +3 -0
  38. package/Samples/ContextAPIMixpanel/android/app/src/main/res/values/styles.xml +9 -0
  39. package/Samples/ContextAPIMixpanel/android/build.gradle +38 -0
  40. package/Samples/ContextAPIMixpanel/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  41. package/Samples/ContextAPIMixpanel/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  42. package/Samples/ContextAPIMixpanel/android/gradle.properties +28 -0
  43. package/Samples/ContextAPIMixpanel/android/gradlew +185 -0
  44. package/Samples/ContextAPIMixpanel/android/gradlew.bat +89 -0
  45. package/Samples/ContextAPIMixpanel/android/settings.gradle +3 -0
  46. package/Samples/ContextAPIMixpanel/app.json +4 -0
  47. package/Samples/ContextAPIMixpanel/babel.config.js +3 -0
  48. package/Samples/ContextAPIMixpanel/index.js +9 -0
  49. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/AppDelegate.h +8 -0
  50. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/AppDelegate.m +62 -0
  51. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
  52. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/Images.xcassets/Contents.json +6 -0
  53. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/Info.plist +55 -0
  54. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/LaunchScreen.storyboard +47 -0
  55. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel/main.m +9 -0
  56. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel-Bridging-Header.h +4 -0
  57. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel.xcodeproj/project.pbxproj +694 -0
  58. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel.xcodeproj/xcshareddata/xcschemes/ContextAPIMixpanel.xcscheme +88 -0
  59. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel.xcworkspace/contents.xcworkspacedata +10 -0
  60. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanel.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  61. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanelTests/ContextAPIMixpanelTests.m +65 -0
  62. package/Samples/ContextAPIMixpanel/ios/ContextAPIMixpanelTests/Info.plist +24 -0
  63. package/Samples/ContextAPIMixpanel/ios/File.swift +8 -0
  64. package/Samples/ContextAPIMixpanel/ios/Podfile +29 -0
  65. package/Samples/ContextAPIMixpanel/metro.config.js +17 -0
  66. package/Samples/ContextAPIMixpanel/package.json +30 -0
  67. package/Samples/ContextAPIMixpanel/yarn.lock +6770 -0
  68. package/Samples/MixpanelDemo/.buckconfig +6 -0
  69. package/Samples/MixpanelDemo/.eslintrc.js +4 -0
  70. package/Samples/MixpanelDemo/.flowconfig +73 -0
  71. package/Samples/MixpanelDemo/.gitattributes +1 -0
  72. package/Samples/MixpanelDemo/.prettierrc.js +6 -0
  73. package/Samples/MixpanelDemo/.watchmanconfig +1 -0
  74. package/Samples/MixpanelDemo/Analytics.js +15 -0
  75. package/Samples/MixpanelDemo/App.js +11 -0
  76. package/Samples/MixpanelDemo/Router.js +35 -0
  77. package/Samples/MixpanelDemo/__tests__/App-test.js +3 -0
  78. package/Samples/MixpanelDemo/android/.project +28 -0
  79. package/Samples/MixpanelDemo/android/app/BUCK +55 -0
  80. package/Samples/MixpanelDemo/android/app/build.gradle +219 -0
  81. package/Samples/MixpanelDemo/android/app/build_defs.bzl +19 -0
  82. package/Samples/MixpanelDemo/android/app/debug.keystore +0 -0
  83. package/Samples/MixpanelDemo/android/app/proguard-rules.pro +10 -0
  84. package/Samples/MixpanelDemo/android/app/src/debug/AndroidManifest.xml +8 -0
  85. package/Samples/MixpanelDemo/android/app/src/debug/java/com/mixpaneldemo/ReactNativeFlipper.java +72 -0
  86. package/Samples/MixpanelDemo/android/app/src/main/AndroidManifest.xml +27 -0
  87. package/Samples/MixpanelDemo/android/app/src/main/java/com/MixpanelDemo/MainActivity.java +15 -0
  88. package/Samples/MixpanelDemo/android/app/src/main/java/com/MixpanelDemo/MainApplication.java +81 -0
  89. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  90. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  91. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  92. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  93. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  94. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  95. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  96. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  97. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  98. package/Samples/MixpanelDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  99. package/Samples/MixpanelDemo/android/app/src/main/res/values/strings.xml +3 -0
  100. package/Samples/MixpanelDemo/android/app/src/main/res/values/styles.xml +9 -0
  101. package/Samples/MixpanelDemo/android/build.gradle +37 -0
  102. package/Samples/MixpanelDemo/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  103. package/Samples/MixpanelDemo/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  104. package/Samples/MixpanelDemo/android/gradle.properties +28 -0
  105. package/Samples/MixpanelDemo/android/gradlew +183 -0
  106. package/Samples/MixpanelDemo/android/gradlew.bat +103 -0
  107. package/Samples/MixpanelDemo/android/settings.gradle +5 -0
  108. package/Samples/MixpanelDemo/app.json +5 -0
  109. package/Samples/MixpanelDemo/babel.config.js +3 -0
  110. package/Samples/MixpanelDemo/index.js +9 -0
  111. package/Samples/MixpanelDemo/ios/Empty.swift +8 -0
  112. package/Samples/MixpanelDemo/ios/MixpanelDemo/AppDelegate.h +8 -0
  113. package/Samples/MixpanelDemo/ios/MixpanelDemo/AppDelegate.m +58 -0
  114. package/Samples/MixpanelDemo/ios/MixpanelDemo/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
  115. package/Samples/MixpanelDemo/ios/MixpanelDemo/Images.xcassets/Contents.json +6 -0
  116. package/Samples/MixpanelDemo/ios/MixpanelDemo/Info.plist +57 -0
  117. package/Samples/MixpanelDemo/ios/MixpanelDemo/LaunchScreen.storyboard +58 -0
  118. package/Samples/MixpanelDemo/ios/MixpanelDemo/main.m +9 -0
  119. package/Samples/MixpanelDemo/ios/MixpanelDemo-Bridging-Header.h +4 -0
  120. package/Samples/MixpanelDemo/ios/MixpanelDemo-tvOS/Info.plist +53 -0
  121. package/Samples/MixpanelDemo/ios/MixpanelDemo-tvOSTests/Info.plist +24 -0
  122. package/Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/project.pbxproj +977 -0
  123. package/Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/xcshareddata/xcschemes/MixpanelDemo-tvOS.xcscheme +88 -0
  124. package/Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/xcshareddata/xcschemes/MixpanelDemo.xcscheme +88 -0
  125. package/Samples/MixpanelDemo/ios/MixpanelDemo.xcworkspace/contents.xcworkspacedata +10 -0
  126. package/Samples/MixpanelDemo/ios/MixpanelDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  127. package/Samples/MixpanelDemo/ios/MixpanelDemoTests/Info.plist +24 -0
  128. package/Samples/MixpanelDemo/ios/MixpanelDemoTests/MixpanelDemoTests.m +65 -0
  129. package/Samples/MixpanelDemo/ios/Podfile +24 -0
  130. package/Samples/MixpanelDemo/metro.config.js +17 -0
  131. package/Samples/MixpanelDemo/package.json +40 -0
  132. package/Samples/MixpanelDemo/screens/EventScreen.js +156 -0
  133. package/Samples/MixpanelDemo/screens/GDPRScreen.js +63 -0
  134. package/Samples/MixpanelDemo/screens/GroupScreen.js +142 -0
  135. package/Samples/MixpanelDemo/screens/Home.js +54 -0
  136. package/Samples/MixpanelDemo/screens/ProfileScreen.js +184 -0
  137. package/Samples/MixpanelDemo/yarn.lock +6945 -0
  138. package/Samples/README.md +39 -0
  139. package/Samples/SimpleMixpanel/.buckconfig +6 -0
  140. package/Samples/SimpleMixpanel/.editorconfig +3 -0
  141. package/Samples/SimpleMixpanel/.eslintrc.js +4 -0
  142. package/Samples/SimpleMixpanel/.flowconfig +66 -0
  143. package/Samples/SimpleMixpanel/.gitattributes +3 -0
  144. package/Samples/SimpleMixpanel/.prettierrc.js +7 -0
  145. package/Samples/SimpleMixpanel/.watchmanconfig +1 -0
  146. package/Samples/SimpleMixpanel/App.js +42 -0
  147. package/Samples/SimpleMixpanel/__tests__/App-test.js +14 -0
  148. package/Samples/SimpleMixpanel/android/.project +28 -0
  149. package/Samples/SimpleMixpanel/android/app/BUCK +55 -0
  150. package/Samples/SimpleMixpanel/android/app/build.gradle +222 -0
  151. package/Samples/SimpleMixpanel/android/app/build_defs.bzl +19 -0
  152. package/Samples/SimpleMixpanel/android/app/debug.keystore +0 -0
  153. package/Samples/SimpleMixpanel/android/app/proguard-rules.pro +10 -0
  154. package/Samples/SimpleMixpanel/android/app/src/debug/AndroidManifest.xml +13 -0
  155. package/Samples/SimpleMixpanel/android/app/src/debug/java/com/simplemixpanel/ReactNativeFlipper.java +72 -0
  156. package/Samples/SimpleMixpanel/android/app/src/main/AndroidManifest.xml +25 -0
  157. package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainActivity.java +15 -0
  158. package/Samples/SimpleMixpanel/android/app/src/main/java/com/simplemixpanel/MainApplication.java +80 -0
  159. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  160. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  161. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  162. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  163. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  164. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  165. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  166. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  167. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  168. package/Samples/SimpleMixpanel/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  169. package/Samples/SimpleMixpanel/android/app/src/main/res/values/strings.xml +3 -0
  170. package/Samples/SimpleMixpanel/android/app/src/main/res/values/styles.xml +9 -0
  171. package/Samples/SimpleMixpanel/android/build.gradle +38 -0
  172. package/Samples/SimpleMixpanel/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  173. package/Samples/SimpleMixpanel/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  174. package/Samples/SimpleMixpanel/android/gradle.properties +28 -0
  175. package/Samples/SimpleMixpanel/android/gradlew +185 -0
  176. package/Samples/SimpleMixpanel/android/gradlew.bat +89 -0
  177. package/Samples/SimpleMixpanel/android/settings.gradle +3 -0
  178. package/Samples/SimpleMixpanel/app.json +4 -0
  179. package/Samples/SimpleMixpanel/babel.config.js +3 -0
  180. package/Samples/SimpleMixpanel/index.js +9 -0
  181. package/Samples/SimpleMixpanel/ios/File.swift +8 -0
  182. package/Samples/SimpleMixpanel/ios/Podfile +29 -0
  183. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/AppDelegate.h +8 -0
  184. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/AppDelegate.m +62 -0
  185. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
  186. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/Images.xcassets/Contents.json +6 -0
  187. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/Info.plist +55 -0
  188. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/LaunchScreen.storyboard +47 -0
  189. package/Samples/SimpleMixpanel/ios/SimpleMixpanel/main.m +9 -0
  190. package/Samples/SimpleMixpanel/ios/SimpleMixpanel-Bridging-Header.h +4 -0
  191. package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcodeproj/project.pbxproj +694 -0
  192. package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcodeproj/xcshareddata/xcschemes/SimpleMixpanel.xcscheme +88 -0
  193. package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcworkspace/contents.xcworkspacedata +10 -0
  194. package/Samples/SimpleMixpanel/ios/SimpleMixpanel.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  195. package/Samples/SimpleMixpanel/ios/SimpleMixpanelTests/Info.plist +24 -0
  196. package/Samples/SimpleMixpanel/ios/SimpleMixpanelTests/SimpleMixpanelTests.m +65 -0
  197. package/Samples/SimpleMixpanel/metro.config.js +17 -0
  198. package/Samples/SimpleMixpanel/package.json +30 -0
  199. package/Samples/SimpleMixpanel/yarn.lock +6770 -0
  200. package/__tests__/index.test.js +1 -1
  201. package/android/build.gradle +1 -1
  202. package/docs/Mixpanel.html +1 -1
  203. package/docs/MixpanelGroup.html +1 -1
  204. package/docs/People.html +1 -1
  205. package/docs/index.html +5 -3
  206. package/docs/index.js.html +1 -1
  207. package/ios/MixpanelReactNative-Bridging-Header.h +0 -4
  208. package/ios/MixpanelReactNative.swift +7 -1
  209. package/ios/MixpanelTypeHandler.swift +1 -1
  210. package/package.json +25 -24
  211. package/release.py +3 -3
@@ -73,7 +73,7 @@ jobs:
73
73
  run: yarn install
74
74
  - name: Setup iOS
75
75
  working-directory: ./Samples/SimpleMixpanel/ios
76
- run: pod install
76
+ run: pod install --repo-update
77
77
  - name: Test iOS
78
78
  working-directory: ./Samples/SimpleMixpanel
79
79
  run: yarn ios
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  #
2
2
 
3
+ ## [v1.3.4](https://github.com/mixpanel/mixpanel-react-native/tree/v1.3.4) (2021-09-25)
4
+
5
+ **Closed issues:**
6
+
7
+ - ANDROID\_NDK\_HOME error when building Android with version 1.3.3 [\#101](https://github.com/mixpanel/mixpanel-react-native/issues/101)
8
+ - \[Android\] Build fails after Maven migration [\#94](https://github.com/mixpanel/mixpanel-react-native/issues/94)
9
+ - \[Android\] Mixpanel not working after upgrading React Native to 0.65.0 [\#93](https://github.com/mixpanel/mixpanel-react-native/issues/93)
10
+ - Mixpanel.library is always displayed react-native [\#92](https://github.com/mixpanel/mixpanel-react-native/issues/92)
11
+ - App Session events don't seem to be logged after v1.2.4 [\#91](https://github.com/mixpanel/mixpanel-react-native/issues/91)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Bump native SDK dependencies [\#102](https://github.com/mixpanel/mixpanel-react-native/pull/102)
16
+
17
+ #
18
+
3
19
  ## [v1.3.3](https://github.com/mixpanel/mixpanel-react-native/tree/v1.3.3) (2021-09-21)
4
20
 
5
21
  ### Fixes
@@ -98,3 +114,5 @@
98
114
 
99
115
 
100
116
 
117
+
118
+
@@ -19,5 +19,5 @@ Pod::Spec.new do |s|
19
19
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
20
20
 
21
21
  s.dependency "React"
22
- s.dependency "Mixpanel-swift", '3.0.0.beta.5'
22
+ s.dependency "Mixpanel-swift", '3.0.0'
23
23
  end
package/README.md CHANGED
@@ -45,7 +45,8 @@ npm install mixpanel-react-native
45
45
  pod install
46
46
  ```
47
47
  Please note: You do not need to update your Podfile to add Mixpanel.
48
- 3. For Xcode 12.5+, there is a known compile issue, please refer to this **[workaround](https://github.com/mixpanel/mixpanel-react-native/issues/43#issuecomment-829599732)**.
48
+
49
+ 3. Since Xcode 12.5, there is a known swift compile issue, please refer to this **[workaround](https://github.com/mixpanel/mixpanel-react-native/issues/43#issuecomment-829599732)**. However the compile issue has been resolved in Xcode 13.2.1+, there is no extra step required as long as you upgrade to Xcode 13.2.1+.
49
50
 
50
51
 
51
52
  ### 2. Initialize Mixpanel
@@ -0,0 +1,6 @@
1
+
2
+ [android]
3
+ target = Google Inc.:Google APIs:23
4
+
5
+ [maven_repositories]
6
+ central = https://repo1.maven.org/maven2
@@ -0,0 +1,3 @@
1
+ # Windows files
2
+ [*.bat]
3
+ end_of_line = crlf
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native-community',
4
+ };
@@ -0,0 +1,66 @@
1
+ [ignore]
2
+ ; We fork some components by platform
3
+ .*/*[.]android.js
4
+
5
+ ; Ignore "BUCK" generated dirs
6
+ <PROJECT_ROOT>/\.buckd/
7
+
8
+ ; Ignore polyfills
9
+ node_modules/react-native/Libraries/polyfills/.*
10
+
11
+ ; Flow doesn't support platforms
12
+ .*/Libraries/Utilities/LoadingView.js
13
+
14
+ [untyped]
15
+ .*/node_modules/@react-native-community/cli/.*/.*
16
+
17
+ [include]
18
+
19
+ [libs]
20
+ node_modules/react-native/interface.js
21
+ node_modules/react-native/flow/
22
+
23
+ [options]
24
+ emoji=true
25
+
26
+ esproposal.optional_chaining=enable
27
+ esproposal.nullish_coalescing=enable
28
+
29
+ exact_by_default=true
30
+
31
+ module.file_ext=.js
32
+ module.file_ext=.json
33
+ module.file_ext=.ios.js
34
+
35
+ munge_underscores=true
36
+
37
+ module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
38
+ module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'
39
+
40
+ suppress_type=$FlowIssue
41
+ suppress_type=$FlowFixMe
42
+ suppress_type=$FlowFixMeProps
43
+ suppress_type=$FlowFixMeState
44
+
45
+ [lints]
46
+ sketchy-null-number=warn
47
+ sketchy-null-mixed=warn
48
+ sketchy-number=warn
49
+ untyped-type-import=warn
50
+ nonstrict-import=warn
51
+ deprecated-type=warn
52
+ unsafe-getters-setters=warn
53
+ unnecessary-invariant=warn
54
+ signature-verification-failure=warn
55
+
56
+ [strict]
57
+ deprecated-type
58
+ nonstrict-import
59
+ sketchy-null
60
+ unclear-type
61
+ unsafe-getters-setters
62
+ untyped-import
63
+ untyped-type-import
64
+
65
+ [version]
66
+ ^0.137.0
@@ -0,0 +1,3 @@
1
+ # Windows files should use crlf line endings
2
+ # https://help.github.com/articles/dealing-with-line-endings/
3
+ *.bat text eol=crlf
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ bracketSpacing: false,
3
+ jsxBracketSameLine: true,
4
+ singleQuote: true,
5
+ trailingComma: 'all',
6
+ arrowParens: 'avoid',
7
+ };
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { Mixpanel } from 'mixpanel-react-native';
3
+
4
+ const MixpanelContext = React.createContext();
5
+
6
+ export const useMixpanel = () => React.useContext(MixpanelContext);
7
+
8
+ export const MixpanelProvider = ({children}) => {
9
+ const [mixpanel, setMixpanel] = React.useState(null);
10
+
11
+ React.useEffect(() => {
12
+ const mixpanelInstance = new Mixpanel(`Your Project Token`);
13
+ mixpanelInstance.init();
14
+ setMixpanel(mixpanelInstance);
15
+ }, []);
16
+
17
+ return <MixpanelContext.Provider value={mixpanel}>{children}</MixpanelContext.Provider>;
18
+ };
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { SafeAreaView } from "react-native";
3
+ import { MixpanelProvider } from './Analytics';
4
+ import { SampleScreen } from './Screens/SampleScreen';
5
+
6
+
7
+ const App = () => {
8
+ return (
9
+ <SafeAreaView>
10
+ <MixpanelProvider>
11
+ <SampleScreen />
12
+ </MixpanelProvider>
13
+ </SafeAreaView>
14
+ )
15
+ }
16
+
17
+ export default App;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Button, SafeAreaView } from "react-native";
3
+ import { useMixpanel } from '../Analytics';
4
+
5
+ export const SampleScreen = () => {
6
+ const mixpanel = useMixpanel();
7
+ return (
8
+ <SafeAreaView>
9
+ <Button
10
+ title="Select Premium Plan"
11
+ onPress={() => {
12
+ mixpanel.track("Plan Selected", {"Plan": "Premium"});
13
+ }}
14
+ />
15
+ </SafeAreaView>
16
+ );
17
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import 'react-native';
6
+ import React from 'react';
7
+ import App from '../App';
8
+
9
+ // Note: test renderer must be required after react-native.
10
+ import renderer from 'react-test-renderer';
11
+
12
+ it('renders correctly', () => {
13
+ renderer.create(<App />);
14
+ });
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>android_</name>
4
+ <comment>Project android_ created by Buildship.</comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ <buildCommand>
9
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
10
+ <arguments>
11
+ </arguments>
12
+ </buildCommand>
13
+ </buildSpec>
14
+ <natures>
15
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
16
+ </natures>
17
+ <filteredResources>
18
+ <filter>
19
+ <id>1632526110612</id>
20
+ <name></name>
21
+ <type>30</type>
22
+ <matcher>
23
+ <id>org.eclipse.core.resources.regexFilterMatcher</id>
24
+ <arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25
+ </matcher>
26
+ </filter>
27
+ </filteredResources>
28
+ </projectDescription>
@@ -0,0 +1,55 @@
1
+ # To learn about Buck see [Docs](https://buckbuild.com/).
2
+ # To run your application with Buck:
3
+ # - install Buck
4
+ # - `npm start` - to start the packager
5
+ # - `cd android`
6
+ # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7
+ # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8
+ # - `buck install -r android/app` - compile, install and run application
9
+ #
10
+
11
+ load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12
+
13
+ lib_deps = []
14
+
15
+ create_aar_targets(glob(["libs/*.aar"]))
16
+
17
+ create_jar_targets(glob(["libs/*.jar"]))
18
+
19
+ android_library(
20
+ name = "all-libs",
21
+ exported_deps = lib_deps,
22
+ )
23
+
24
+ android_library(
25
+ name = "app-code",
26
+ srcs = glob([
27
+ "src/main/java/**/*.java",
28
+ ]),
29
+ deps = [
30
+ ":all-libs",
31
+ ":build_config",
32
+ ":res",
33
+ ],
34
+ )
35
+
36
+ android_build_config(
37
+ name = "build_config",
38
+ package = "com.contextapimixpanel",
39
+ )
40
+
41
+ android_resource(
42
+ name = "res",
43
+ package = "com.contextapimixpanel",
44
+ res = "src/main/res",
45
+ )
46
+
47
+ android_binary(
48
+ name = "app",
49
+ keystore = "//android/keystores:debug",
50
+ manifest = "src/main/AndroidManifest.xml",
51
+ package_type = "debug",
52
+ deps = [
53
+ ":app-code",
54
+ ],
55
+ )
@@ -0,0 +1,222 @@
1
+ apply plugin: "com.android.application"
2
+
3
+ import com.android.build.OutputFile
4
+
5
+ /**
6
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7
+ * and bundleReleaseJsAndAssets).
8
+ * These basically call `react-native bundle` with the correct arguments during the Android build
9
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10
+ * bundle directly from the development server. Below you can see all the possible configurations
11
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
12
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
13
+ *
14
+ * project.ext.react = [
15
+ * // the name of the generated asset file containing your JS bundle
16
+ * bundleAssetName: "index.android.bundle",
17
+ *
18
+ * // the entry file for bundle generation. If none specified and
19
+ * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20
+ * // default. Can be overridden with ENTRY_FILE environment variable.
21
+ * entryFile: "index.android.js",
22
+ *
23
+ * // https://reactnative.dev/docs/performance#enable-the-ram-format
24
+ * bundleCommand: "ram-bundle",
25
+ *
26
+ * // whether to bundle JS and assets in debug mode
27
+ * bundleInDebug: false,
28
+ *
29
+ * // whether to bundle JS and assets in release mode
30
+ * bundleInRelease: true,
31
+ *
32
+ * // whether to bundle JS and assets in another build variant (if configured).
33
+ * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34
+ * // The configuration property can be in the following formats
35
+ * // 'bundleIn${productFlavor}${buildType}'
36
+ * // 'bundleIn${buildType}'
37
+ * // bundleInFreeDebug: true,
38
+ * // bundleInPaidRelease: true,
39
+ * // bundleInBeta: true,
40
+ *
41
+ * // whether to disable dev mode in custom build variants (by default only disabled in release)
42
+ * // for example: to disable dev mode in the staging build type (if configured)
43
+ * devDisabledInStaging: true,
44
+ * // The configuration property can be in the following formats
45
+ * // 'devDisabledIn${productFlavor}${buildType}'
46
+ * // 'devDisabledIn${buildType}'
47
+ *
48
+ * // the root of your project, i.e. where "package.json" lives
49
+ * root: "../../",
50
+ *
51
+ * // where to put the JS bundle asset in debug mode
52
+ * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53
+ *
54
+ * // where to put the JS bundle asset in release mode
55
+ * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56
+ *
57
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
58
+ * // require('./image.png')), in debug mode
59
+ * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60
+ *
61
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
62
+ * // require('./image.png')), in release mode
63
+ * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64
+ *
65
+ * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66
+ * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67
+ * // date; if you have any other folders that you want to ignore for performance reasons (gradle
68
+ * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69
+ * // for example, you might want to remove it from here.
70
+ * inputExcludes: ["android/**", "ios/**"],
71
+ *
72
+ * // override which node gets called and with what additional arguments
73
+ * nodeExecutableAndArgs: ["node"],
74
+ *
75
+ * // supply additional arguments to the packager
76
+ * extraPackagerArgs: []
77
+ * ]
78
+ */
79
+
80
+ project.ext.react = [
81
+ enableHermes: false, // clean and rebuild if changing
82
+ ]
83
+
84
+ apply from: "../../node_modules/react-native/react.gradle"
85
+
86
+ /**
87
+ * Set this to true to create two separate APKs instead of one:
88
+ * - An APK that only works on ARM devices
89
+ * - An APK that only works on x86 devices
90
+ * The advantage is the size of the APK is reduced by about 4MB.
91
+ * Upload all the APKs to the Play Store and people will download
92
+ * the correct one based on the CPU architecture of their device.
93
+ */
94
+ def enableSeparateBuildPerCPUArchitecture = false
95
+
96
+ /**
97
+ * Run Proguard to shrink the Java bytecode in release builds.
98
+ */
99
+ def enableProguardInReleaseBuilds = false
100
+
101
+ /**
102
+ * The preferred build flavor of JavaScriptCore.
103
+ *
104
+ * For example, to use the international variant, you can use:
105
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
106
+ *
107
+ * The international variant includes ICU i18n library and necessary data
108
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
109
+ * give correct results when using with locales other than en-US. Note that
110
+ * this variant is about 6MiB larger per architecture than default.
111
+ */
112
+ def jscFlavor = 'org.webkit:android-jsc:+'
113
+
114
+ /**
115
+ * Whether to enable the Hermes VM.
116
+ *
117
+ * This should be set on project.ext.react and mirrored here. If it is not set
118
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119
+ * and the benefits of using Hermes will therefore be sharply reduced.
120
+ */
121
+ def enableHermes = project.ext.react.get("enableHermes", false);
122
+
123
+ android {
124
+ ndkVersion rootProject.ext.ndkVersion
125
+
126
+ compileSdkVersion rootProject.ext.compileSdkVersion
127
+
128
+ compileOptions {
129
+ sourceCompatibility JavaVersion.VERSION_1_8
130
+ targetCompatibility JavaVersion.VERSION_1_8
131
+ }
132
+
133
+ defaultConfig {
134
+ applicationId "com.contextapimixpanel"
135
+ minSdkVersion rootProject.ext.minSdkVersion
136
+ targetSdkVersion rootProject.ext.targetSdkVersion
137
+ versionCode 1
138
+ versionName "1.0"
139
+ }
140
+ splits {
141
+ abi {
142
+ reset()
143
+ enable enableSeparateBuildPerCPUArchitecture
144
+ universalApk false // If true, also generate a universal APK
145
+ include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
146
+ }
147
+ }
148
+ signingConfigs {
149
+ debug {
150
+ storeFile file('debug.keystore')
151
+ storePassword 'android'
152
+ keyAlias 'androiddebugkey'
153
+ keyPassword 'android'
154
+ }
155
+ }
156
+ buildTypes {
157
+ debug {
158
+ signingConfig signingConfigs.debug
159
+ }
160
+ release {
161
+ // Caution! In production, you need to generate your own keystore file.
162
+ // see https://reactnative.dev/docs/signed-apk-android.
163
+ signingConfig signingConfigs.debug
164
+ minifyEnabled enableProguardInReleaseBuilds
165
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
166
+ }
167
+ }
168
+
169
+ // applicationVariants are e.g. debug, release
170
+ applicationVariants.all { variant ->
171
+ variant.outputs.each { output ->
172
+ // For each separate APK per architecture, set a unique version code as described here:
173
+ // https://developer.android.com/studio/build/configure-apk-splits.html
174
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
175
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
176
+ def abi = output.getFilter(OutputFile.ABI)
177
+ if (abi != null) { // null for the universal-debug, universal-release variants
178
+ output.versionCodeOverride =
179
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
180
+ }
181
+
182
+ }
183
+ }
184
+ }
185
+
186
+ dependencies {
187
+ implementation fileTree(dir: "libs", include: ["*.jar"])
188
+ //noinspection GradleDynamicVersion
189
+ implementation "com.facebook.react:react-native:+" // From node_modules
190
+
191
+ implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
192
+
193
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
194
+ exclude group:'com.facebook.fbjni'
195
+ }
196
+
197
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
198
+ exclude group:'com.facebook.flipper'
199
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
200
+ }
201
+
202
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
203
+ exclude group:'com.facebook.flipper'
204
+ }
205
+
206
+ if (enableHermes) {
207
+ def hermesPath = "../../node_modules/hermes-engine/android/";
208
+ debugImplementation files(hermesPath + "hermes-debug.aar")
209
+ releaseImplementation files(hermesPath + "hermes-release.aar")
210
+ } else {
211
+ implementation jscFlavor
212
+ }
213
+ }
214
+
215
+ // Run this once to be able to run the application with BUCK
216
+ // puts all compile dependencies into folder libs for BUCK to use
217
+ task copyDownloadableDepsToLibs(type: Copy) {
218
+ from configurations.compile
219
+ into 'libs'
220
+ }
221
+
222
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@@ -0,0 +1,19 @@
1
+ """Helper definitions to glob .aar and .jar targets"""
2
+
3
+ def create_aar_targets(aarfiles):
4
+ for aarfile in aarfiles:
5
+ name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6
+ lib_deps.append(":" + name)
7
+ android_prebuilt_aar(
8
+ name = name,
9
+ aar = aarfile,
10
+ )
11
+
12
+ def create_jar_targets(jarfiles):
13
+ for jarfile in jarfiles:
14
+ name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15
+ lib_deps.append(":" + name)
16
+ prebuilt_jar(
17
+ name = name,
18
+ binary_jar = jarfile,
19
+ )
@@ -0,0 +1,10 @@
1
+ # Add project specific ProGuard rules here.
2
+ # By default, the flags in this file are appended to flags specified
3
+ # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4
+ # You can edit the include path and order by changing the proguardFiles
5
+ # directive in build.gradle.
6
+ #
7
+ # For more details, see
8
+ # http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+ # Add any project specific keep options here:
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+
5
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
+
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12
+ </application>
13
+ </manifest>
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5
+ * directory of this source tree.
6
+ */
7
+ package com.contextapimixpanel;
8
+
9
+ import android.content.Context;
10
+ import com.facebook.flipper.android.AndroidFlipperClient;
11
+ import com.facebook.flipper.android.utils.FlipperUtils;
12
+ import com.facebook.flipper.core.FlipperClient;
13
+ import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14
+ import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15
+ import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16
+ import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17
+ import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18
+ import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19
+ import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20
+ import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21
+ import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22
+ import com.facebook.react.ReactInstanceManager;
23
+ import com.facebook.react.bridge.ReactContext;
24
+ import com.facebook.react.modules.network.NetworkingModule;
25
+ import okhttp3.OkHttpClient;
26
+
27
+ public class ReactNativeFlipper {
28
+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29
+ if (FlipperUtils.shouldEnableFlipper(context)) {
30
+ final FlipperClient client = AndroidFlipperClient.getInstance(context);
31
+
32
+ client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33
+ client.addPlugin(new ReactFlipperPlugin());
34
+ client.addPlugin(new DatabasesFlipperPlugin(context));
35
+ client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36
+ client.addPlugin(CrashReporterPlugin.getInstance());
37
+
38
+ NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
39
+ NetworkingModule.setCustomClientBuilder(
40
+ new NetworkingModule.CustomClientBuilder() {
41
+ @Override
42
+ public void apply(OkHttpClient.Builder builder) {
43
+ builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
44
+ }
45
+ });
46
+ client.addPlugin(networkFlipperPlugin);
47
+ client.start();
48
+
49
+ // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
50
+ // Hence we run if after all native modules have been initialized
51
+ ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52
+ if (reactContext == null) {
53
+ reactInstanceManager.addReactInstanceEventListener(
54
+ new ReactInstanceManager.ReactInstanceEventListener() {
55
+ @Override
56
+ public void onReactContextInitialized(ReactContext reactContext) {
57
+ reactInstanceManager.removeReactInstanceEventListener(this);
58
+ reactContext.runOnNativeModulesQueueThread(
59
+ new Runnable() {
60
+ @Override
61
+ public void run() {
62
+ client.addPlugin(new FrescoFlipperPlugin());
63
+ }
64
+ });
65
+ }
66
+ });
67
+ } else {
68
+ client.addPlugin(new FrescoFlipperPlugin());
69
+ }
70
+ }
71
+ }
72
+ }