apps-sdk 1.0.49 → 1.0.51
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/index.js +2 -1
- package/package.json +1 -1
- package/src/libraries/Networking.js +4 -0
- package/src/libraries/TrackingTransparency.js +11 -2
- package/types/index.d.ts +1 -0
package/config.js
CHANGED
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {NotificationsPush, Networking, Storage, Session, Utils, PayWallLogic, Rating, AdJust} from "./src/libraries";
|
|
1
|
+
import {NotificationsPush, Networking, Storage, Session, Utils, PayWallLogic, Rating, AdJust, TrackingTransparency} from "./src/libraries";
|
|
2
2
|
import PayWall from "./src/components/PayWall";
|
|
3
3
|
|
|
4
4
|
class AppsSDK {
|
|
@@ -21,5 +21,6 @@ export default {
|
|
|
21
21
|
rating: Rating,
|
|
22
22
|
paywallLogic: PayWallLogic,
|
|
23
23
|
adjust: AdJust,
|
|
24
|
+
tracking: TrackingTransparency,
|
|
24
25
|
paywall: PayWall,
|
|
25
26
|
}
|
package/package.json
CHANGED
|
@@ -168,6 +168,10 @@ class Networking {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
sendEvent = async (eventType, eventKeyword, eventData={}) => {
|
|
171
|
+
if (config.TRACKING_ACTIVE === false) {
|
|
172
|
+
console.log('Event not sent, tracking is denied: ', eventType, eventKeyword);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
171
175
|
config.DEBUG_MODE && console.debug("sendEvent", eventType, eventKeyword, eventData);
|
|
172
176
|
try {
|
|
173
177
|
AdJust.trackEventIfExist(eventKeyword);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as ExpoTrackingTransparency from 'expo-tracking-transparency';
|
|
2
2
|
import Storage from './Storage';
|
|
3
3
|
import Networking from './Networking';
|
|
4
|
+
import * as config from '../../config';
|
|
4
5
|
|
|
5
6
|
class TrackingTransparency {
|
|
6
7
|
async requestTrackingTransparencyPermission() {
|
|
8
|
+
let trackingResult = 'granted';
|
|
7
9
|
let trackingPermission = await Storage.getData('TRACKING_PERMISSION');
|
|
8
10
|
if (!trackingPermission || trackingPermission !== 'granted') {
|
|
9
|
-
const { status } = await requestTrackingPermissionsAsync();
|
|
11
|
+
const { status } = await ExpoTrackingTransparency.requestTrackingPermissionsAsync();
|
|
10
12
|
if (status === 'granted') {
|
|
11
13
|
Storage.storeData('TRACKING_PERMISSION', 'granted');
|
|
12
14
|
Networking.sendEvent('action', 'tracking_consent');
|
|
@@ -14,9 +16,16 @@ class TrackingTransparency {
|
|
|
14
16
|
} else {
|
|
15
17
|
Storage.storeData('TRACKING_PERMISSION', 'denied');
|
|
16
18
|
Networking.sendEvent('action', 'tracking_denied');
|
|
19
|
+
trackingResult = 'denied';
|
|
17
20
|
console.log('Tracking Transparency permission denied');
|
|
18
21
|
}
|
|
19
22
|
}
|
|
23
|
+
config.TRACKING_ACTIVE = (trackingResult === 'granted');
|
|
24
|
+
return trackingResult;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getAdvertisingIdentifier() {
|
|
28
|
+
return ExpoTrackingTransparency.getAdvertisingId();
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
|