apps-sdk 1.0.80 → 1.0.82

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.0.80",
3
+ "version": "1.0.82",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,17 +12,23 @@ class AdJust {
12
12
  const adjustEnvironment = config.ADJUST.ENVIRONMENT === 'SANDBOX' ? AdjustConfig.EnvironmentSandbox : AdjustConfig.EnvironmentProduction;
13
13
  const adjustLogLevel = config.ADJUST.LOG_LEVEL === 'VERBOSE' ? AdjustConfig.LogLevelVerbose : AdjustConfig.LogLevelSuppress;
14
14
  console.log("Initializing AdJust. Environment: " + adjustEnvironment + ", Log level: " + adjustLogLevel);
15
- const adjustConfig = new AdjustConfig(config.ADJUST.ADJUST_TOKEN, adjustEnvironment);
16
- adjustConfig.setLogLevel(adjustLogLevel);
17
- const self = this;
18
- adjustConfig.setAttributionCallbackListener(function(attribution) {
19
- self.attribution = attribution;
20
- setTimeout(() => {
21
- self.sendAttributionData(attribution);
22
- }, 30000);
23
- });
24
- Adjust.create(adjustConfig)
25
- this.updateAttributionInfo();
15
+ try {
16
+ const adjustConfig = new AdjustConfig(config.ADJUST.ADJUST_TOKEN, adjustEnvironment);
17
+ adjustConfig.setLogLevel(adjustLogLevel);
18
+ const self = this;
19
+ adjustConfig.setAttributionCallbackListener(function (attribution) {
20
+ self.attribution = attribution;
21
+ setTimeout(() => {
22
+ self.sendAttributionData(attribution);
23
+ }, 30000);
24
+ });
25
+ Adjust.create(adjustConfig)
26
+ this.updateAttributionInfo();
27
+ Networking.sendEvent('other', 'adjust_init_ok');
28
+ } catch (e) {
29
+ console.log('Error en inicialización de AdJust', e);
30
+ Networking.sendEvent('other', 'adjust_init_error');
31
+ }
26
32
  }
27
33
 
28
34
  updateAttributionInfo() {
@@ -220,7 +220,7 @@ class Networking {
220
220
  }
221
221
  return null;
222
222
  } catch (error) {
223
- console.error(error);
223
+ console.log('Error al enviar evento a AdJust', error);
224
224
  }
225
225
  }
226
226
  }
@@ -51,6 +51,15 @@ class Storage {
51
51
  }
52
52
  }
53
53
 
54
+
55
+ async removeAllKeys() {
56
+ try {
57
+ await AsyncStorage.clear();
58
+ } catch (error) {
59
+ console.error('Error removing all data from AsyncStorage:', error);
60
+ }
61
+ }
62
+
54
63
  async handleRequestGalleryPermission() {
55
64
  try {
56
65
  let galleryPermission = await this.getData('GALLERY_PERMISSION');
package/types/index.d.ts CHANGED
@@ -92,6 +92,7 @@ declare module 'apps-sdk' {
92
92
  handleDownloadImageToGallery(imageURI: string): Promise<string>;
93
93
  handleRequestGalleryPermission(): Promise<string>;
94
94
  setTrackingPermissionGranted(value: boolean): void;
95
+ removeAllKeys(): Promise<void>;
95
96
  }
96
97
 
97
98
  export class Utils {