apps-sdk 1.1.22 → 1.1.24
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/Adapty.js +16 -0
- package/src/libraries/PayWallLogic.js +20 -10
- package/types/index.d.ts +2 -0
package/package.json
CHANGED
package/src/libraries/Adapty.js
CHANGED
|
@@ -134,6 +134,22 @@ class Adapty {
|
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
|
|
138
|
+
async updateAdjustAttributionData(adjustData) {
|
|
139
|
+
try {
|
|
140
|
+
await adapty.updateAttribution(adjustData, 'adjust');
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error('Error updating attribution data:', error);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async setAdjustIntegrationIdentifier(integrationIdentifier) {
|
|
147
|
+
try {
|
|
148
|
+
await adapty.setIntegrationIdentifier('adjust_device_id', integrationIdentifier);
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error('Error setting integration identifier:', error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
137
153
|
}
|
|
138
154
|
|
|
139
155
|
export default new Adapty();
|
|
@@ -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",
|
package/types/index.d.ts
CHANGED
|
@@ -219,6 +219,8 @@ declare module 'apps-sdk' {
|
|
|
219
219
|
preloadPaywall(placementID: any, lang: any): Promise<any>
|
|
220
220
|
showPaywallPreloaded(paywallView: any, eventHandlers?: PaywallEventHandlers): Promise<void>;
|
|
221
221
|
getProfile(): Promise<any>;
|
|
222
|
+
updateAdjustAttributionData(attribution: any): Promise<void>;
|
|
223
|
+
setAdjustIntegrationIdentifier(adjustIntegrationIdentifier: string): Promise<void>;
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
export class TrackingTransparency {
|