apps-sdk 1.1.1 → 1.1.3
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
CHANGED
|
@@ -171,7 +171,7 @@ class PayWall extends React.Component {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
MixPanel.trackEvent('Paywall Plan Selected' ,{
|
|
174
|
-
|
|
174
|
+
"plan_type": data.id,
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
if (this.paywallData && data.id && data.id.length > 0) {
|
|
@@ -223,10 +223,10 @@ class PayWall extends React.Component {
|
|
|
223
223
|
case data.eventName === 'on_boarding' && data.eventValue.toString().substring(0, 4) === 'step':
|
|
224
224
|
const stepNumber = data.eventValue.toString().substring(4);
|
|
225
225
|
MixPanel.trackEvent('Onboarding Screen Viewed', {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
"onboarding_id": config.PAYWALL_DATA.others.on_boarding.dsn_id.toString(),
|
|
227
|
+
"onboarding_total_steps": 4,
|
|
228
|
+
"onboarding_step": stepNumber,
|
|
229
|
+
"onboarding_step_keyword": data.eventName + '_' + data.eventValue,
|
|
230
230
|
});
|
|
231
231
|
Networking.sendEvent('action', 'onb_tap_continue_' + data.eventValue, {step: data.eventValue, onboarding_id: config.PAYWALL_DATA.others.on_boarding.dsn_id});
|
|
232
232
|
break;
|
package/src/libraries/AdJust.js
CHANGED
|
@@ -20,7 +20,7 @@ class AdJust {
|
|
|
20
20
|
const self = this;
|
|
21
21
|
adjustConfig.setAttributionCallback(function (attribution) {
|
|
22
22
|
self.attribution = attribution;
|
|
23
|
-
Networking.sendEvent('other', 'adjust_attribution_received', attribution);
|
|
23
|
+
Networking.sendEvent('other', 'adjust_attribution_received', attribution, true);
|
|
24
24
|
setTimeout(() => {
|
|
25
25
|
self.sendAttributionData(attribution);
|
|
26
26
|
}, 30000);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Mixpanel } from "mixpanel-react-native";
|
|
2
2
|
import * as config from '../../config';
|
|
3
3
|
import Networking from "./Networking";
|
|
4
|
+
import Storage from "./Storage";
|
|
4
5
|
|
|
5
6
|
class MixPanel {
|
|
6
7
|
constructor() {
|
|
@@ -31,7 +32,8 @@ class MixPanel {
|
|
|
31
32
|
|
|
32
33
|
try {
|
|
33
34
|
if (!this.devMode) {
|
|
34
|
-
|
|
35
|
+
const trackingPermissionAnswered = await Storage.getData('TRACKING_PERMISSION_ANSWERED');
|
|
36
|
+
if (config.TRACKING_ACTIVE || !trackingPermissionAnswered) {
|
|
35
37
|
await this.mixpanel.track(eventName, properties);
|
|
36
38
|
config.DEBUG_MODE && console.log(`MixPanel Event tracked: ${eventName} with properties:`, properties);
|
|
37
39
|
} else {
|
|
@@ -230,7 +230,8 @@ class Networking {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
sendEvent = async (eventType, eventKeyword, eventData={}, forceSend = false) => {
|
|
233
|
-
|
|
233
|
+
const trackingPermissionAnswered = await storage.getData('TRACKING_PERMISSION_ANSWERED');
|
|
234
|
+
if (trackingPermissionAnswered && config.TRACKING_ACTIVE === false && Platform.OS === 'ios' && !forceSend) {
|
|
234
235
|
console.log('Event not sent, tracking is denied (iOS): ', eventType, eventKeyword);
|
|
235
236
|
console.log('Tracking answered: ', config.TRACKING_ANSWERED);
|
|
236
237
|
if (!config.TRACKING_ANSWERED) {
|
|
@@ -57,7 +57,11 @@ class PayWallLogic {
|
|
|
57
57
|
"subscription_status": "premium",
|
|
58
58
|
"plan_type": purchase.productId,
|
|
59
59
|
});
|
|
60
|
-
|
|
60
|
+
if (data.subs_id) {
|
|
61
|
+
Mixpanel.identifyUser(data.subs_id);
|
|
62
|
+
} else {
|
|
63
|
+
console.log('No subs_id in purchaseResp');
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
67
|
} catch (error) {
|
|
@@ -86,7 +90,11 @@ class PayWallLogic {
|
|
|
86
90
|
"subscription_status": "premium",
|
|
87
91
|
"plan_type": purchase.productId,
|
|
88
92
|
});
|
|
89
|
-
|
|
93
|
+
if (data.subs_id) {
|
|
94
|
+
Mixpanel.identifyUser(data.subs_id);
|
|
95
|
+
} else {
|
|
96
|
+
console.log('No subs_id in purchaseResp');
|
|
97
|
+
}
|
|
90
98
|
} else {
|
|
91
99
|
console.log('SDK checkSubscription fail')
|
|
92
100
|
}
|