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 +1 -1
- package/src/libraries/AdJust.js +17 -11
- package/src/libraries/Networking.js +1 -1
- package/src/libraries/Storage.js +9 -0
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
package/src/libraries/AdJust.js
CHANGED
|
@@ -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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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() {
|
package/src/libraries/Storage.js
CHANGED
|
@@ -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 {
|