mixpanel-react-native 3.0.7 → 3.0.9

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.
@@ -185,7 +185,7 @@ describe("MixpanelMain", () => {
185
185
  const optOutTrackingDefault = false;
186
186
  const superProperties = {superProp1: "value1", superProp2: "value2"};
187
187
  const serverURL = "https://api.mixpanel.com";
188
- console.info("here111");
188
+
189
189
  await mixpanelMain.initialize(
190
190
  token,
191
191
  trackAutomaticEvents,
@@ -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.5.2'
44
+ implementation 'com.mixpanel.android:mixpanel-android:8.0.3'
45
45
  }
@@ -26,7 +26,7 @@ export const MixpanelNetwork = (() => {
26
26
  headers: {
27
27
  "Content-Type": "application/x-www-form-urlencoded",
28
28
  },
29
- body: `data=${JSON.stringify(data)}`,
29
+ body: `data=${encodeURIComponent(JSON.stringify(data))}`,
30
30
  });
31
31
 
32
32
  const responseBody = await response.json();
@@ -2,11 +2,18 @@ import {MixpanelPersistent} from "./mixpanel-persistent";
2
2
 
3
3
  export const MixpanelQueueManager = (() => {
4
4
  let _queues = {};
5
- const mixpanelPersistent = MixpanelPersistent.getInstance();
5
+ let mixpanelPersistent;
6
+
7
+ const getPersistent = () => {
8
+ if (!mixpanelPersistent) {
9
+ mixpanelPersistent = MixpanelPersistent.getInstance();
10
+ }
11
+ return mixpanelPersistent;
12
+ };
6
13
 
7
14
  const initialize = async (token, type) => {
8
15
  if (!_queues[token] || !_queues[token][type]) {
9
- const queue = await mixpanelPersistent.loadQueue(token, type);
16
+ const queue = await getPersistent().loadQueue(token, type);
10
17
  _queues[token] = {
11
18
  ..._queues[token],
12
19
  [type]: queue,
@@ -18,7 +25,7 @@ export const MixpanelQueueManager = (() => {
18
25
  if (!_queues[token] || !_queues[token][type]) {
19
26
  return;
20
27
  }
21
- await mixpanelPersistent.saveQueue(token, type, _queues[token][type]);
28
+ await getPersistent().saveQueue(token, type, _queues[token][type]);
22
29
  };
23
30
 
24
31
  const enqueue = async (token, type, data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-react-native",
3
- "version": "3.0.7",
3
+ "version": "3.0.9",
4
4
  "description": "Official React Native Tracking Library for Mixpanel Analytics",
5
5
  "main": "index.js",
6
6
  "scripts": {