apps-sdk 1.0.89 → 1.0.90
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
package/src/libraries/AdJust.js
CHANGED
|
@@ -8,10 +8,11 @@ import Networking from './Networking';
|
|
|
8
8
|
class AdJust {
|
|
9
9
|
sdkVersion = null;
|
|
10
10
|
attribution = {};
|
|
11
|
-
initialize() {
|
|
11
|
+
async initialize() {
|
|
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
|
+
await storage.setTrackingPermissionFromStorage()
|
|
15
|
+
console.log("Initializing AdJust. Environment: " + adjustEnvironment + ", Log level: " + adjustLogLevel + ", config.TRACKING_ACTIVE: " + config.TRACKING_ACTIVE);
|
|
15
16
|
try {
|
|
16
17
|
const adjustConfig = new AdjustConfig(config.ADJUST.ADJUST_TOKEN, adjustEnvironment);
|
|
17
18
|
adjustConfig.setLogLevel(adjustLogLevel);
|
|
@@ -6,6 +6,7 @@ import AdJust from './AdJust';
|
|
|
6
6
|
import CryptoES from "crypto-es";
|
|
7
7
|
import semver from 'semver';
|
|
8
8
|
import Constants from 'expo-constants';
|
|
9
|
+
import { Platform } from 'react-native';
|
|
9
10
|
|
|
10
11
|
class Networking {
|
|
11
12
|
constructor() {
|
|
@@ -209,8 +210,8 @@ class Networking {
|
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
sendEvent = async (eventType, eventKeyword, eventData={}) => {
|
|
212
|
-
if (config.TRACKING_ACTIVE === false) {
|
|
213
|
-
console.log('Event not sent, tracking is denied: ', eventType, eventKeyword);
|
|
213
|
+
if (config.TRACKING_ACTIVE === false && Platform.OS === 'ios') {
|
|
214
|
+
console.log('Event not sent, tracking is denied (iOS): ', eventType, eventKeyword);
|
|
214
215
|
console.log('Tracking answered: ', config.TRACKING_ANSWERED);
|
|
215
216
|
if (!config.TRACKING_ANSWERED) {
|
|
216
217
|
this.addPendingEvent({eventType, eventKeyword, eventData});
|
package/src/libraries/Storage.js
CHANGED
|
@@ -278,6 +278,17 @@ class Storage {
|
|
|
278
278
|
config.TRACKING_ACTIVE = value;
|
|
279
279
|
this.storeData('TRACKING_PERMISSION', value ? 'granted' : 'denied');
|
|
280
280
|
}
|
|
281
|
+
|
|
282
|
+
async setTrackingPermissionFromStorage() {
|
|
283
|
+
this.getData('TRACKING_PERMISSION').then(value => {
|
|
284
|
+
console.log('Setting tracking permission from storage:', (value === 'granted'));
|
|
285
|
+
if (value === 'granted') {
|
|
286
|
+
config.TRACKING_ACTIVE = true;
|
|
287
|
+
} else {
|
|
288
|
+
config.TRACKING_ACTIVE = false;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
281
292
|
}
|
|
282
293
|
|
|
283
294
|
export default new Storage();
|
package/types/index.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ declare module 'apps-sdk' {
|
|
|
97
97
|
handleDownloadImageToGallery(imageURI: string): Promise<string>;
|
|
98
98
|
handleRequestGalleryPermission(): Promise<string>;
|
|
99
99
|
setTrackingPermissionGranted(value: boolean): void;
|
|
100
|
+
setTrackingPermissionFromStorage(): Promise<void>;
|
|
100
101
|
removeAllKeys(): Promise<void>;
|
|
101
102
|
deleteTempFiles(): Promise<void>;
|
|
102
103
|
}
|
|
@@ -134,7 +135,7 @@ declare module 'apps-sdk' {
|
|
|
134
135
|
export class AdJust {
|
|
135
136
|
sdkVersion: string | null;
|
|
136
137
|
attribution: object;
|
|
137
|
-
initialize(): void
|
|
138
|
+
initialize(): Promise<void>;
|
|
138
139
|
updateAttributionInfo(): void;
|
|
139
140
|
getAttributionData(): Promise<any>;
|
|
140
141
|
sendAttributionData(attribution: any): Promise<void>;
|