apps-sdk 1.1.22 → 1.1.23
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/package.json +1 -1
- package/src/libraries/PayWallLogic.js +20 -10
package/package.json
CHANGED
|
@@ -57,12 +57,17 @@ class PayWallLogic {
|
|
|
57
57
|
"subscription_status": "premium",
|
|
58
58
|
"plan_type": purchase.productId,
|
|
59
59
|
});
|
|
60
|
-
if (purchaseResponse.
|
|
61
|
-
await Mixpanel.
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
if (purchaseResponse.data.origin_user_id) {
|
|
61
|
+
const currentMixpanelUser = await Mixpanel.getDistinctID();
|
|
62
|
+
if (currentMixpanelUser !== purchaseResponse.data.origin_user_id) {
|
|
63
|
+
await Mixpanel.resetUserID();
|
|
64
|
+
await Mixpanel.identifyUser(purchaseResponse.data.origin_user_id);
|
|
65
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser by previous user', data.subs_id);
|
|
66
|
+
} else {
|
|
67
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser not needed (same user_id)');
|
|
68
|
+
}
|
|
64
69
|
} else {
|
|
65
|
-
console.log('
|
|
70
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser (origin_user_id missing)');
|
|
66
71
|
}
|
|
67
72
|
await Mixpanel.superProperties({
|
|
68
73
|
"subscription_status": "premium",
|
|
@@ -92,12 +97,17 @@ class PayWallLogic {
|
|
|
92
97
|
if (data.source) {
|
|
93
98
|
Networking.sendEvent('action', 'subscription_from_source', {source: data.source});
|
|
94
99
|
}
|
|
95
|
-
if (data.
|
|
96
|
-
await Mixpanel.
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
if (purchaseResponse.data.origin_user_id) {
|
|
101
|
+
const currentMixpanelUser = await Mixpanel.getDistinctID();
|
|
102
|
+
if (currentMixpanelUser !== purchaseResponse.data.origin_user_id) {
|
|
103
|
+
await Mixpanel.resetUserID();
|
|
104
|
+
await Mixpanel.identifyUser(purchaseResponse.data.origin_user_id);
|
|
105
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser by previous user', data.subs_id);
|
|
106
|
+
} else {
|
|
107
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser not needed (same user_id)');
|
|
108
|
+
}
|
|
99
109
|
} else {
|
|
100
|
-
console.log('
|
|
110
|
+
console.log('SDK purchaseUpdatedListener Mixpanel identifyUser (origin_user_id missing)');
|
|
101
111
|
}
|
|
102
112
|
await Mixpanel.superProperties({
|
|
103
113
|
"subscription_status": "premium",
|