apps-sdk 1.1.83 → 1.1.85

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.83",
3
+ "version": "1.1.85",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "author": "ASD",
@@ -34,7 +34,7 @@
34
34
  "@react-native-community/netinfo": "11.4.1",
35
35
  "@react-native-voice/voice": "^3.2.4",
36
36
  "franc-min": "^6.2.0",
37
- "mixpanel-react-native": "^3.0.9",
37
+ "mixpanel-react-native": "^3.1.3",
38
38
  "react-native-btr": "^2.2.1",
39
39
  "react-native-webview": "13.12.5",
40
40
  "semver": "^7.6.0"
@@ -105,18 +105,43 @@ 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
114
 
111
115
  try {
112
- if (!this.devMode && userID) {
116
+ // Validar formato: YYYYMMDDHHMMSS_[hash_hexadecimal]
117
+ const userIDRegex = /^\d{14}_[a-f0-9]+$/;
118
+ const isValidFormat = userIDRegex.test(userID);
119
+
120
+ if (!this.devMode && userID && isValidFormat) {
113
121
  await this.mixpanel.identify(userID);
122
+
123
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_success', {
124
+ user_id: userID
125
+ });
126
+
114
127
  config.DEBUG_MODE && console.log('MixPanel User identified:', userID);
128
+ } else if (!this.devMode && userID && !isValidFormat) {
129
+ console.error('MixPanel: Invalid userID format. Expected format: YYYYMMDDHHMMSS_[hex], received:', userID);
130
+
131
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_failed', {
132
+ user_id: userID,
133
+ error: 'invalid_format'
134
+ });
115
135
  } else {
116
136
  config.DEBUG_MODE && console.log('MixPanel User identified but not send (DEV_MODE ON):', userID);
117
137
  }
118
138
  } catch (error) {
119
139
  console.error('Error identifying user:', error);
140
+
141
+ Networking.sendEvent('other', 'mixpanel_sdk_identify_failed', {
142
+ user_id: userID,
143
+ error: error.message
144
+ });
120
145
  }
121
146
  }
122
147
 
@@ -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);