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
@@ -0,0 +1,142 @@
1
+ import React from 'react';
2
+ import {Text, TouchableOpacity, StyleSheet, View, ScrollView} from 'react-native';
3
+ import {MixpanelInstance} from '../Analytics';
4
+
5
+ export default class GroupScreen extends React.Component {
6
+
7
+ constructor(props) {
8
+ super(props);
9
+ this.mixpanel = MixpanelInstance;
10
+ this.group = this.mixpanel.getGroup("company_id", 12345);
11
+ }
12
+
13
+ setProperty = () => {
14
+ this.group.set("prop_key", "prop_value");
15
+ }
16
+
17
+ setPropertyOnce = () => {
18
+ this.group.setOnce("prop_key", "prop_value");
19
+ }
20
+
21
+ unsetProperty = () => {
22
+ this.group.unset("aaa");
23
+ }
24
+
25
+ removeProperty = () => {
26
+ this.group.remove("prop_key", "334");
27
+ }
28
+
29
+ unionProperty = () => {
30
+ this.group.union("prop_key", ["prop_value_a", "prop_value_b"]);
31
+ }
32
+
33
+ deleteGroup = () => {
34
+ this.mixpanel.deleteGroup("company_id", 12345);
35
+ }
36
+
37
+ setGroup = () => {
38
+ this.mixpanel.setGroup("company_id", 12345);
39
+ }
40
+
41
+ addGroup = () => {
42
+ this.mixpanel.addGroup("company_id", 111);
43
+ }
44
+
45
+ removeGroup = () => {
46
+ this.mixpanel.removeGroup("company_id", 323);
47
+ }
48
+
49
+ trackWithGroups = () => {
50
+ this.mixpanel.trackWithGroups("tracked with groups", {"a": 1, "b": 2.3}, {"company_id": "Mixpanel"});
51
+ }
52
+
53
+ flush = () => {
54
+ this.mixpanel.flush();
55
+ }
56
+
57
+ render() {
58
+ return (
59
+ <ScrollView>
60
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
61
+ <TouchableOpacity style={styles.button} onPress={this.setProperty}>
62
+ <Text style={styles.buttonText}>Set One Property</Text>
63
+ </TouchableOpacity>
64
+ </View>
65
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
66
+ <TouchableOpacity style={styles.button} onPress={this.setPropertyOnce}>
67
+ <Text style={styles.buttonText}>Set Properties Once</Text>
68
+ </TouchableOpacity>
69
+ </View>
70
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
71
+ <TouchableOpacity style={styles.button} onPress={this.unsetProperty}>
72
+ <Text style={styles.buttonText}>Unset Property</Text>
73
+ </TouchableOpacity>
74
+ </View>
75
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
76
+ <TouchableOpacity style={styles.button} onPress={this.removeProperty}>
77
+ <Text style={styles.buttonText}>Remove Property</Text>
78
+ </TouchableOpacity>
79
+ </View>
80
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
81
+ <TouchableOpacity style={styles.button} onPress={this.unionProperty}>
82
+ <Text style={styles.buttonText}>Union Properties</Text>
83
+ </TouchableOpacity>
84
+ </View>
85
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
86
+ <TouchableOpacity style={styles.button} onPress={this.deleteGroup}>
87
+ <Text style={styles.buttonText}>Delete Group</Text>
88
+ </TouchableOpacity>
89
+ </View>
90
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
91
+ <TouchableOpacity style={styles.button} onPress={this.setGroup}>
92
+ <Text style={styles.buttonText}>Set Group</Text>
93
+ </TouchableOpacity>
94
+ </View>
95
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
96
+ <TouchableOpacity style={styles.button} onPress={this.addGroup}>
97
+ <Text style={styles.buttonText}>Add Group</Text>
98
+ </TouchableOpacity>
99
+ </View>
100
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
101
+ <TouchableOpacity style={styles.button} onPress={this.removeGroup}>
102
+ <Text style={styles.buttonText}>Remove Group</Text>
103
+ </TouchableOpacity>
104
+ </View>
105
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
106
+ <TouchableOpacity style={styles.button} onPress={this.trackWithGroups}>
107
+ <Text style={styles.buttonText}>Track with Groups</Text>
108
+ </TouchableOpacity>
109
+ </View>
110
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
111
+ <TouchableOpacity style={styles.button} onPress={this.flush}>
112
+ <Text style={styles.buttonText}>Flush</Text>
113
+ </TouchableOpacity>
114
+ </View>
115
+ </ScrollView>
116
+ );
117
+ }
118
+ }
119
+
120
+ const styles = StyleSheet.create({
121
+ button: {
122
+ backgroundColor: '#1E90FF',
123
+ width: '100%',
124
+ alignItems: 'center',
125
+ marginVertical: 10,
126
+ paddingVertical: 10,
127
+ },
128
+ buttonText: {
129
+ fontSize: 16,
130
+ fontWeight: '500',
131
+ color: '#ffffff',
132
+ textAlign: "center"
133
+ },
134
+ touchableOpacity: {
135
+ backgroundColor: '#1E90FF',
136
+ borderRadius: 25,
137
+ width: '100%',
138
+ alignItems: 'center',
139
+ marginVertical: 10,
140
+ paddingVertical: 10,
141
+ }
142
+ })
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import {StyleSheet, SafeAreaView, View, Button, ScrollView} from 'react-native';
3
+
4
+
5
+ const Separator = () => (
6
+ <View style={styles.separator} />
7
+ );
8
+
9
+ class HomeScreen extends React.Component {
10
+ /**
11
+ Navigate screen to Welcome page
12
+ */
13
+ navigateEvent = () => {
14
+ this.props.navigation.navigate('Event');
15
+ }
16
+
17
+ navigateProfile = () => {
18
+ this.props.navigation.navigate('Profile');
19
+ }
20
+
21
+ navigateGDPR = () => {
22
+ this.props.navigation.navigate('GDPR');
23
+ }
24
+
25
+ navigateGroup = () => {
26
+ this.props.navigation.navigate('Group');
27
+ }
28
+
29
+ render() {
30
+ return (
31
+ <SafeAreaView>
32
+ <ScrollView >
33
+ <Separator />
34
+ <Button onPress={this.navigateEvent} title='Event' />
35
+ <Separator />
36
+ <Button onPress={this.navigateProfile} title='Profile' />
37
+ <Separator />
38
+ <Button onPress={this.navigateGDPR} title='GDPR' />
39
+ <Separator />
40
+ <Button onPress={this.navigateGroup} title='Group' />
41
+ <Separator />
42
+ </ScrollView>
43
+ </SafeAreaView>
44
+ );
45
+ }
46
+ }
47
+
48
+ const styles = StyleSheet.create({
49
+ separator: {
50
+ marginVertical: 15,
51
+ }
52
+ })
53
+
54
+ export default HomeScreen;
@@ -0,0 +1,184 @@
1
+ import React from 'react';
2
+ import {Text, TouchableOpacity, StyleSheet, View, ScrollView} from 'react-native';
3
+ import {MixpanelInstance} from '../Analytics';
4
+
5
+ export default class ProfileScreen extends React.Component {
6
+
7
+ constructor(props) {
8
+ super(props);
9
+ this.mixpanel = MixpanelInstance;
10
+ }
11
+
12
+ createAlias = () => {
13
+ this.mixpanel.alias("New Alias", "testDistinctId");
14
+ }
15
+
16
+ reset = () => {
17
+ this.mixpanel.reset();
18
+ }
19
+
20
+ setProperty = () => {
21
+ this.mixpanel.getPeople().set({
22
+ "a": 1,
23
+ "b": 2.3,
24
+ "c": ["4", 5],
25
+ });
26
+ }
27
+
28
+ setOneProperty = () => {
29
+ this.mixpanel.getPeople().set("d", "yo");
30
+ }
31
+
32
+ setOnePropertyOnce = () => {
33
+ this.mixpanel.getPeople().setOnce("c", "just once");
34
+ }
35
+
36
+ unsetProperties = () => {
37
+ this.mixpanel.getPeople().unset("a");
38
+ }
39
+
40
+ incrementProperty = () => {
41
+ this.mixpanel.getPeople().increment("a", 1.2);
42
+ }
43
+
44
+ removePropertyValue = () => {
45
+ this.mixpanel.getPeople().remove("c", 5);
46
+ }
47
+
48
+ appendProperties = () => {
49
+ this.mixpanel.getPeople().append("e", "Hello");
50
+ }
51
+
52
+ unionProperties = () => {
53
+ this.mixpanel.getPeople().union("a", ["goodbye", "hi"]);
54
+ }
55
+
56
+ trackChargeWithoutProperties = () => {
57
+ this.mixpanel.getPeople().trackCharge(22.8);
58
+ }
59
+
60
+ trackCharge = () => {
61
+ this.mixpanel.getPeople().trackCharge(12.8, {"sandwich": 1});
62
+ }
63
+
64
+ clearCharges = () => {
65
+ this.mixpanel.getPeople().clearCharges();
66
+ }
67
+
68
+ deleteUser = () => {
69
+ this.mixpanel.getPeople().deleteUser();
70
+ }
71
+
72
+ /**
73
+ Push all queued Mixpanel events and People Analytics changes to Mixpanel servers.
74
+ */
75
+ flush = () => {
76
+ this.mixpanel.flush();
77
+ }
78
+
79
+ render() {
80
+ return (
81
+ <ScrollView>
82
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
83
+ <TouchableOpacity style={styles.button} onPress={this.createAlias}>
84
+ <Text style={styles.buttonText}>Create Alias</Text>
85
+ </TouchableOpacity>
86
+ </View>
87
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
88
+ <TouchableOpacity style={styles.button} onPress={this.reset}>
89
+ <Text style={styles.buttonText}>Reset</Text>
90
+ </TouchableOpacity>
91
+ </View>
92
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
93
+ <TouchableOpacity style={styles.button} onPress={this.setProperty}>
94
+ <Text style={styles.buttonText}>Set Properties</Text>
95
+ </TouchableOpacity>
96
+ </View>
97
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
98
+ <TouchableOpacity style={styles.button} onPress={this.setOneProperty}>
99
+ <Text style={styles.buttonText}>Set One Property</Text>
100
+ </TouchableOpacity>
101
+ </View>
102
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
103
+ <TouchableOpacity style={styles.button} onPress={this.setOnePropertyOnce}>
104
+ <Text style={styles.buttonText}>Set Properties Once</Text>
105
+ </TouchableOpacity>
106
+ </View>
107
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
108
+ <TouchableOpacity style={styles.button} onPress={this.unsetProperties}>
109
+ <Text style={styles.buttonText}>Unset Properties</Text>
110
+ </TouchableOpacity>
111
+ </View>
112
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
113
+ <TouchableOpacity style={styles.button} onPress={this.incrementProperty}>
114
+ <Text style={styles.buttonText}>Increment Property</Text>
115
+ </TouchableOpacity>
116
+ </View>
117
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
118
+ <TouchableOpacity style={styles.button} onPress={this.removePropertyValue}>
119
+ <Text style={styles.buttonText}>Remove Property Value</Text>
120
+ </TouchableOpacity>
121
+ </View>
122
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
123
+ <TouchableOpacity style={styles.button} onPress={this.appendProperties}>
124
+ <Text style={styles.buttonText}>Append Properties</Text>
125
+ </TouchableOpacity>
126
+ </View>
127
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
128
+ <TouchableOpacity style={styles.button} onPress={this.unionProperties}>
129
+ <Text style={styles.buttonText}>Union Properties</Text>
130
+ </TouchableOpacity>
131
+ </View>
132
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
133
+ <TouchableOpacity style={styles.button} onPress={this.trackChargeWithoutProperties}>
134
+ <Text style={styles.buttonText}>Track Charge w/o Properties</Text>
135
+ </TouchableOpacity>
136
+ </View>
137
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
138
+ <TouchableOpacity style={styles.button} onPress={this.trackCharge}>
139
+ <Text style={styles.buttonText}>Track Charge w Properties</Text>
140
+ </TouchableOpacity>
141
+ </View>
142
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
143
+ <TouchableOpacity style={styles.button} onPress={this.clearCharges}>
144
+ <Text style={styles.buttonText}>Clear Charges</Text>
145
+ </TouchableOpacity>
146
+ </View>
147
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
148
+ <TouchableOpacity style={styles.button} onPress={this.deleteUser}>
149
+ <Text style={styles.buttonText}>Delete User</Text>
150
+ </TouchableOpacity>
151
+ </View>
152
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
153
+ <TouchableOpacity style={styles.button} onPress={this.flush}>
154
+ <Text style={styles.buttonText}>Flush</Text>
155
+ </TouchableOpacity>
156
+ </View>
157
+ </ScrollView>
158
+ );
159
+ }
160
+ }
161
+
162
+ const styles = StyleSheet.create({
163
+ button: {
164
+ backgroundColor: '#1E90FF',
165
+ width: '100%',
166
+ alignItems: 'center',
167
+ marginVertical: 10,
168
+ paddingVertical: 10,
169
+ },
170
+ buttonText: {
171
+ fontSize: 16,
172
+ fontWeight: '500',
173
+ color: '#ffffff',
174
+ textAlign: "center"
175
+ },
176
+ touchableOpacity: {
177
+ backgroundColor: '#1E90FF',
178
+ borderRadius: 25,
179
+ width: '100%',
180
+ alignItems: 'center',
181
+ marginVertical: 10,
182
+ paddingVertical: 10,
183
+ }
184
+ })