apps-sdk 1.1.82 → 1.1.84

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.82",
3
+ "version": "1.1.84",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "author": "ASD",
@@ -105,18 +105,42 @@ class MixPanel {
105
105
  async identifyUser(userID) {
106
106
  if (!this.mixpanel) {
107
107
  console.log('Mixpanel is not initialized');
108
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_failed', {
109
+ user_id: userID,
110
+ error: 'mixpanel_not_initialized'
111
+ });
108
112
  return;
109
113
  }
110
-
111
114
  try {
112
- if (!this.devMode && userID) {
115
+ // format: YYYYMMDDHHMMSS_[hash_hexadecimal]
116
+ const userIDRegex = /^\d{14}_[a-f0-9]+$/;
117
+ const isValidFormat = userIDRegex.test(userID);
118
+
119
+ if (!this.devMode && userID && isValidFormat) {
113
120
  await this.mixpanel.identify(userID);
121
+
122
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_success', {
123
+ user_id: userID
124
+ });
125
+
114
126
  config.DEBUG_MODE && console.log('MixPanel User identified:', userID);
127
+ } else if (!this.devMode && userID && !isValidFormat) {
128
+ console.error('MixPanel: Invalid userID format. Expected format: YYYYMMDDHHMMSS_[hex], received:', userID);
129
+
130
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_failed', {
131
+ user_id: userID,
132
+ error: 'invalid_format'
133
+ });
115
134
  } else {
116
135
  config.DEBUG_MODE && console.log('MixPanel User identified but not send (DEV_MODE ON):', userID);
117
136
  }
118
137
  } catch (error) {
119
138
  console.error('Error identifying user:', error);
139
+
140
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_failed', {
141
+ user_id: userID,
142
+ error: error.message
143
+ });
120
144
  }
121
145
  }
122
146
 
@@ -51,13 +51,23 @@ class NotificationsPush {
51
51
  try {
52
52
  const {status: existingStatus} = await Notifications.getPermissionsAsync();
53
53
  let finalStatus = existingStatus;
54
+
54
55
  if (existingStatus !== 'granted') {
56
+ Networking.sendEvent('other', 'push_banner_shown', { platform: Platform.OS });
57
+ MixPanel.trackEvent('push_banner_shown', { platform: Platform.OS });
58
+
55
59
  const {status} = await Notifications.requestPermissionsAsync();
56
60
  finalStatus = status;
61
+
57
62
  if (finalStatus === 'granted') {
58
- Networking.sendEvent('action', 'allow_notifications');
63
+ Networking.sendEvent('other', 'push_permission_granted', { platform: Platform.OS });
64
+ MixPanel.trackEvent('push_permission_granted', { platform: Platform.OS });
65
+ } else {
66
+ Networking.sendEvent('other', 'push_permission_denied', { platform: Platform.OS });
67
+ MixPanel.trackEvent('push_permission_denied', { platform: Platform.OS });
59
68
  }
60
69
  }
70
+
61
71
  if (finalStatus === 'granted') {
62
72
  token = (await Notifications.getExpoPushTokenAsync({"projectId": Constants.expoConfig.extra.eas.projectId})).data;
63
73
  console.log('Notification token', token);
@@ -5,16 +5,17 @@ import Session from "./Session";
5
5
  import Mixpanel from "./MixPanel";
6
6
  import * as config from "../../config";
7
7
 
8
- import {
9
- finishTransaction,
10
- flushFailedPurchasesCachedAsPendingAndroid,
11
- getAvailablePurchases,
12
- getSubscriptions,
13
- initConnection,
14
- purchaseErrorListener,
15
- purchaseUpdatedListener,
16
- requestSubscription,
17
- } from 'react-native-iap';
8
+ // LEGACY CODE - react-native-iap not used (Adapty handles all payments)
9
+ // import {
10
+ // finishTransaction,
11
+ // flushFailedPurchasesCachedAsPendingAndroid,
12
+ // getAvailablePurchases,
13
+ // getSubscriptions,
14
+ // initConnection,
15
+ // purchaseErrorListener,
16
+ // purchaseUpdatedListener,
17
+ // requestSubscription,
18
+ // } from 'react-native-iap';
18
19
 
19
20
  class PayWallLogic {
20
21
  constructor(props) {
@@ -25,6 +26,10 @@ class PayWallLogic {
25
26
  purchaseErrorSubscription;
26
27
 
27
28
  async initializePayWall() {
29
+ // LEGACY CODE - Not used (Adapty handles all payments)
30
+ console.log('[PayWallLogic] initializePayWall called but skipped (legacy code)');
31
+ return;
32
+ /* COMMENTED OUT - react-native-iap not available
28
33
  try {
29
34
  await initConnection();
30
35
 
@@ -134,6 +139,7 @@ class PayWallLogic {
134
139
  } catch (error) {
135
140
  console.log('Error en initializePayWall', error);
136
141
  }
142
+ */
137
143
  }
138
144
 
139
145
  purchaseResp = async (subscription, purchaseToken) => {
@@ -152,6 +158,11 @@ class PayWallLogic {
152
158
  }
153
159
 
154
160
  executePurchase = async (productID, hideLoaderCallback, hidePayWallCallback) => {
161
+ // LEGACY CODE - Not used (Adapty handles all payments)
162
+ console.log('[PayWallLogic] executePurchase called but skipped (legacy code)');
163
+ if (hideLoaderCallback) hideLoaderCallback();
164
+ return false;
165
+ /* COMMENTED OUT - react-native-iap not available
155
166
  let subscribed = false;
156
167
  try {
157
168
  const subscriptionTemplates = await getSubscriptions({skus: [productID]});
@@ -176,9 +187,15 @@ class PayWallLogic {
176
187
  hideLoaderCallback();
177
188
  }
178
189
  return subscribed;
190
+ */
179
191
  };
180
192
 
181
193
  restorePurchase = async (hideLoaderCallback, hidePayWallCallback) => {
194
+ // LEGACY CODE - Not used (Adapty handles all payments)
195
+ console.log('[PayWallLogic] restorePurchase called but skipped (legacy code)');
196
+ if (hideLoaderCallback) hideLoaderCallback();
197
+ return false;
198
+ /* COMMENTED OUT - react-native-iap not available
182
199
  let subscribed = false;
183
200
  try {
184
201
  const purchases = await getAvailablePurchases();
@@ -209,6 +226,7 @@ class PayWallLogic {
209
226
  hideLoaderCallback();
210
227
  }
211
228
  return subscribed;
229
+ */
212
230
  }
213
231
 
214
232
  purchaseData = (subscription, purchaseToken) => {
@@ -219,6 +237,9 @@ class PayWallLogic {
219
237
  }
220
238
 
221
239
  getSubscriptionInfo = async (productIDs) => {
240
+ // LEGACY CODE - Not used (Adapty handles all payments)
241
+ return {};
242
+ /* COMMENTED OUT - react-native-iap not available
222
243
  let subscriptionsData = {};
223
244
  try {
224
245
  const subscriptionTemplates = await getSubscriptions({skus: productIDs});
@@ -238,6 +259,7 @@ class PayWallLogic {
238
259
  }
239
260
  config.DEBUG_MODE && console.log('subscription Metadata: ', subscriptionsData);
240
261
  return subscriptionsData;
262
+ */
241
263
  }
242
264
 
243
265
  getPayWallJS = async () => {