apps-sdk 1.0.173 → 1.0.174
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/config.js +2 -0
- package/package.json +1 -1
- package/src/libraries/Networking.js +12 -12
- package/types/index.d.ts +1 -2
package/config.js
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import NetInfo from "@react-native-community/netinfo";
|
|
|
3
3
|
import { default as storage } from './Storage';
|
|
4
4
|
import Session from './Session';
|
|
5
5
|
import AdJust from './AdJust';
|
|
6
|
-
import
|
|
6
|
+
import MixPanel from "./MixPanel";
|
|
7
7
|
import semver from 'semver';
|
|
8
8
|
import Constants from 'expo-constants';
|
|
9
9
|
import { Platform } from 'react-native';
|
|
@@ -11,19 +11,9 @@ import utils from "./Utils";
|
|
|
11
11
|
|
|
12
12
|
class Networking {
|
|
13
13
|
constructor() {
|
|
14
|
-
this.ENCRYPT_KEY = null;
|
|
15
|
-
this.DEFAULT_ENCRYPT_VALUE = false;
|
|
16
14
|
this.PENDING_EVENTS = [];
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
setEncryptKey(value) {
|
|
20
|
-
this.ENCRYPT_KEY = value;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
setDefaultEncryptValue(value) {
|
|
24
|
-
this.DEFAULT_ENCRYPT_VALUE = value;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
17
|
async executeInit() {
|
|
28
18
|
config.DEBUG_MODE && console.debug("executeInit");
|
|
29
19
|
try {
|
|
@@ -34,10 +24,11 @@ class Networking {
|
|
|
34
24
|
config.TRACKING_ANSWERED = await storage.getData('TRACKING_PERMISSION_ANSWERED');
|
|
35
25
|
this.setEndpoints(initData.data.domains);
|
|
36
26
|
this.setEvents(initData.data.attribution);
|
|
37
|
-
this.setEventsMixPanel(initData.data.
|
|
27
|
+
this.setEventsMixPanel(initData.data.tracking);
|
|
38
28
|
this.setPayWallData(initData);
|
|
39
29
|
this.checkSubscription();
|
|
40
30
|
this.setForcedUpdate(initData.data);
|
|
31
|
+
this.setPromoCodesActive(initData.data.promo_codes || false);
|
|
41
32
|
if (initData.data.image) {
|
|
42
33
|
this.setImageCompression(initData.data.image);
|
|
43
34
|
}
|
|
@@ -178,6 +169,14 @@ class Networking {
|
|
|
178
169
|
return updateNeeded;
|
|
179
170
|
}
|
|
180
171
|
|
|
172
|
+
setPromoCodesActive = (active) => {
|
|
173
|
+
config.PROMO_CODES_ACTIVE = active;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
getPromoCodesActive = () => {
|
|
177
|
+
return config.PROMO_CODES_ACTIVE;
|
|
178
|
+
}
|
|
179
|
+
|
|
181
180
|
setEvents(events) {
|
|
182
181
|
events && (config.EVENTS = events);
|
|
183
182
|
}
|
|
@@ -253,6 +252,7 @@ class Networking {
|
|
|
253
252
|
config.DEBUG_MODE && console.debug("sendEvent", eventType, finalKeyword, eventData);
|
|
254
253
|
try {
|
|
255
254
|
AdJust.trackEventIfExist(finalKeyword);
|
|
255
|
+
MixPanel.trackEventIfExist(finalKeyword, eventData);
|
|
256
256
|
let eventResponse = await this.request(config.ENDPOINTS.EVENTS_PUSH, {
|
|
257
257
|
event_name: finalKeyword,
|
|
258
258
|
event_type: eventType,
|
package/types/index.d.ts
CHANGED
|
@@ -68,8 +68,6 @@ declare module 'apps-sdk' {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export class Networking {
|
|
71
|
-
setEncryptKey(key: string): void;
|
|
72
|
-
setDefaultEncryptValue(value: boolean): void;
|
|
73
71
|
executeInit(): Promise<void>;
|
|
74
72
|
setToken(token: string): Promise<boolean | null>;
|
|
75
73
|
request(url: string, data?: any): Promise<any>;
|
|
@@ -85,6 +83,7 @@ declare module 'apps-sdk' {
|
|
|
85
83
|
clearPendingEvents(): void;
|
|
86
84
|
setPayWallData(payWallData: any): void;
|
|
87
85
|
getPayWallData(): any;
|
|
86
|
+
getPromoCodesActive(): boolean;
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
export class Storage {
|