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.
- package/CHANGELOG.md +24 -0
- package/MixpanelReactNative.podspec +1 -1
- package/Samples/ContextAPIMixpanel/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/Samples/MixpanelDemo/android/gradle/wrapper/gradle-wrapper.properties +2 -1
- package/Samples/SimpleMixpanel/package-lock.json +15642 -0
- package/Samples/SimpleMixpanel/package.json +5 -2
- package/Samples/SimpleMixpanel/patches/react-native+0.73.0.patch +14 -0
- package/Samples/SimpleMixpanel/yarn.lock +1527 -1147
- package/__tests__/main.test.js +1 -1
- package/android/build.gradle +1 -1
- package/javascript/mixpanel-network.js +1 -1
- package/javascript/mixpanel-queue.js +10 -3
- package/package.json +1 -1
package/__tests__/main.test.js
CHANGED
|
@@ -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
|
-
|
|
188
|
+
|
|
189
189
|
await mixpanelMain.initialize(
|
|
190
190
|
token,
|
|
191
191
|
trackAutomaticEvents,
|
package/android/build.gradle
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
28
|
+
await getPersistent().saveQueue(token, type, _queues[token][type]);
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
const enqueue = async (token, type, data) => {
|