apps-sdk 1.1.92 → 1.1.93
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/Networking.js +12 -7
package/package.json
CHANGED
|
@@ -156,13 +156,18 @@ class Networking {
|
|
|
156
156
|
console.log('checkSubscription', subStatus);
|
|
157
157
|
if (subStatus && subStatus.success === 1) {
|
|
158
158
|
const currentSubscriptionStatus = await storage.getData('isSubscribed');
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
const isActive = subStatus.data.subscription_active;
|
|
160
|
+
|
|
161
|
+
await Session.setIsSubscribed(isActive);
|
|
162
|
+
const productId = subStatus.data.product_id || 0;
|
|
163
|
+
const planType = (isActive && productId) ? String(productId) : "free";
|
|
164
|
+
|
|
165
|
+
await MixPanel.superProperties({
|
|
166
|
+
"subscription_status": isActive ? "premium" : "free",
|
|
167
|
+
"plan_type": planType,
|
|
168
|
+
"app_version": Session.getAppVersion()
|
|
169
|
+
});
|
|
170
|
+
|
|
166
171
|
await Session.setSubscriptionData(subStatus.data);
|
|
167
172
|
return true;
|
|
168
173
|
}
|