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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.1.92",
3
+ "version": "1.1.93",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "author": "ASD",
@@ -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
- await Session.setIsSubscribed(subStatus.data.subscription_active);
160
- if (currentSubscriptionStatus === false && !subStatus.data.subscription_active === true) {
161
- await MixPanel.superProperties({
162
- "subscription_status": "free",
163
- "plan_type": "free",
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
  }