mixpanel-react-native 3.0.1 → 3.0.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  #
2
2
 
3
+ ## [v3.0.2](https://github.com/mixpanel/mixpanel-react-native/tree/v3.0.2) (2024-04-16)
4
+
5
+ ### Fixes
6
+
7
+ - Avoid crash if AsyncStorage is null [\#235](https://github.com/mixpanel/mixpanel-react-native/pull/235)
8
+
9
+ #
10
+
11
+ ## [v3.0.1](https://github.com/mixpanel/mixpanel-react-native/tree/v3.0.1) (2024-04-11)
12
+
13
+ ### Fixes
14
+
15
+ - Replace the MixpanelReactNative with mixpanelImpl and bump native versions [\#231](https://github.com/mixpanel/mixpanel-react-native/pull/231)
16
+
17
+ **Closed issues:**
18
+
19
+ - Expo managed workflow support [\#82](https://github.com/mixpanel/mixpanel-react-native/issues/82)
20
+ - Feature request: Support react-native-web [\#24](https://github.com/mixpanel/mixpanel-react-native/issues/24)
21
+
22
+ #
23
+
3
24
  ## [v3.0.0](https://github.com/mixpanel/mixpanel-react-native/tree/v3.0.0) (2024-04-09)
4
25
 
5
26
  This is the official release for Expo and React Native Web support. For more details, please refer to the release notes for versions [3.0.0-beta.2](https://github.com/mixpanel/mixpanel-react-native/blob/master/CHANGELOG.md#v300-beta2-2024-03-06) and [3.0.0-beta.1](https://github.com/mixpanel/mixpanel-react-native/blob/master/CHANGELOG.md#v300-beta1-2024-02-29).
@@ -381,3 +402,7 @@ This major release removes all remaining calls to Mixpanel's `/decide` API endpo
381
402
 
382
403
 
383
404
 
405
+
406
+
407
+
408
+
@@ -13,9 +13,9 @@ apply plugin: 'com.android.library'
13
13
  android {
14
14
  compileSdkVersion 33
15
15
  buildToolsVersion "30.0.3"
16
-
16
+
17
17
  def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
18
-
18
+
19
19
  if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
20
20
  namespace "com.mixpanel.reactnative"
21
21
  }
@@ -41,5 +41,5 @@ repositories {
41
41
 
42
42
  dependencies {
43
43
  implementation 'com.facebook.react:react-native:+'
44
- implementation 'com.mixpanel.android:mixpanel-android:7.3.2'
44
+ implementation 'com.mixpanel.android:mixpanel-android:7.5.0'
45
45
  }
@@ -4516,7 +4516,7 @@ To clear all superProperties, use clearSuperProperties()
4516
4516
  <br class="clear">
4517
4517
 
4518
4518
  <footer>
4519
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Apr 11 2024 14:03:23 GMT-0700 (Pacific Daylight Time)
4519
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
4520
4520
  </footer>
4521
4521
 
4522
4522
  <script> prettyPrint(); </script>
@@ -957,7 +957,7 @@ If the property exists and is not list-valued, the union will be ignored.
957
957
  <br class="clear">
958
958
 
959
959
  <footer>
960
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Apr 11 2024 14:03:24 GMT-0700 (Pacific Daylight Time)
960
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
961
961
  </footer>
962
962
 
963
963
  <script> prettyPrint(); </script>
package/docs/People.html CHANGED
@@ -1625,7 +1625,7 @@ If the property exists and is not list-valued, the union will be ignored.
1625
1625
  <br class="clear">
1626
1626
 
1627
1627
  <footer>
1628
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Apr 11 2024 14:03:24 GMT-0700 (Pacific Daylight Time)
1628
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
1629
1629
  </footer>
1630
1630
 
1631
1631
  <script> prettyPrint(); </script>
package/docs/index.html CHANGED
@@ -180,7 +180,7 @@ Please refer to our <a href="https://mixpanel.com/legal/app-store-privacy-detai
180
180
  <br class="clear">
181
181
 
182
182
  <footer>
183
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Apr 11 2024 14:03:23 GMT-0700 (Pacific Daylight Time)
183
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
184
184
  </footer>
185
185
 
186
186
  <script> prettyPrint(); </script>
@@ -110,7 +110,7 @@ export class Mixpanel {
110
110
  superProperties = {},
111
111
  serverURL = "https://api.mixpanel.com"
112
112
  ) {
113
- await MixpanelReactNative.initialize(
113
+ await this.mixpanelImpl.initialize(
114
114
  this.token,
115
115
  this.trackAutomaticEvents,
116
116
  optOutTrackingDefault,
@@ -1048,7 +1048,7 @@ class ObjectHelper {
1048
1048
  <br class="clear">
1049
1049
 
1050
1050
  <footer>
1051
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Thu Apr 11 2024 14:03:23 GMT-0700 (Pacific Daylight Time)
1051
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Apr 15 2024 22:35:54 GMT-0700 (Pacific Daylight Time)
1052
1052
  </footer>
1053
1053
 
1054
1054
  <script> prettyPrint(); </script>
package/index.js CHANGED
@@ -82,7 +82,7 @@ export class Mixpanel {
82
82
  superProperties = {},
83
83
  serverURL = "https://api.mixpanel.com"
84
84
  ) {
85
- await MixpanelReactNative.initialize(
85
+ await this.mixpanelImpl.initialize(
86
86
  this.token,
87
87
  this.trackAutomaticEvents,
88
88
  optOutTrackingDefault,
@@ -3,7 +3,15 @@ import {MixpanelLogger} from "mixpanel-react-native/javascript/mixpanel-logger";
3
3
  export class AsyncStorageAdapter {
4
4
  constructor(storage) {
5
5
  if (!storage) {
6
- this.storage = require("@react-native-async-storage/async-storage");
6
+ try {
7
+ this.storage = require("@react-native-async-storage/async-storage");
8
+ } catch {
9
+ console.error(
10
+ "[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null. Please run 'npm install @react-native-async-storage/async-storage' or follow the Mixpanel guide to set up your own Storage class."
11
+ );
12
+ console.error("[Mixpanel] Falling back to in-memory storage");
13
+ this.storage = new InMemoryStorage();
14
+ }
7
15
  } else {
8
16
  this.storage = storage;
9
17
  }
@@ -34,3 +42,21 @@ export class AsyncStorageAdapter {
34
42
  }
35
43
  }
36
44
  }
45
+
46
+ class InMemoryStorage {
47
+ constructor() {
48
+ this.store = {};
49
+ }
50
+
51
+ async getItem(key) {
52
+ return this.store.hasOwnProperty(key) ? this.store[key] : null;
53
+ }
54
+
55
+ async setItem(key, value) {
56
+ this.store[key] = value;
57
+ }
58
+
59
+ async removeItem(key) {
60
+ delete this.store[key];
61
+ }
62
+ }
@@ -19,6 +19,11 @@
19
19
  "date": 1712859288027,
20
20
  "name": "/Users/zihejia/Documents/Projects/Develop/mixpanel-react-native-original/logs/keplerCliNative-2024-04-11.log",
21
21
  "hash": "049536ba3b6998b543a89803a4423598"
22
+ },
23
+ {
24
+ "date": 1713206392549,
25
+ "name": "/Users/zihejia/Documents/Projects/Develop/mixpanel-react-native-original/logs/keplerCliNative-2024-04-15.log",
26
+ "hash": "f07017339bdf31cfa1a98bc3c5876834"
22
27
  }
23
28
  ]
24
29
  }
@@ -19,6 +19,11 @@
19
19
  "date": 1712859288022,
20
20
  "name": "/Users/zihejia/Documents/Projects/Develop/mixpanel-react-native-original/logs/error-2024-04-11.log",
21
21
  "hash": "2dc3b93023786f58062d972dec596a7e"
22
+ },
23
+ {
24
+ "date": 1713206392540,
25
+ "name": "/Users/zihejia/Documents/Projects/Develop/mixpanel-react-native-original/logs/error-2024-04-15.log",
26
+ "hash": "37cef5cec6ba8a46ca0057fabc4c0d45"
22
27
  }
23
28
  ]
24
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-react-native",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Official React Native Tracking Library for Mixpanel Analytics",
5
5
  "main": "index.js",
6
6
  "scripts": {