apps-sdk 1.0.50 → 1.0.52

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 CHANGED
@@ -36,4 +36,6 @@ export const ADJUST = {
36
36
  LOG_LEVEL : 'VERBOSE'
37
37
  }
38
38
 
39
+ export var TRACKING_ACTIVE = true;
40
+
39
41
  export const DEBUG_MODE = true;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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,15 @@
1
- import * as ExpoTrackingTransparency from 'expo-tracking-transparency';
1
+ import {getAdvertisingId, requestTrackingPermissionsAsync} 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
+ console.log('requestTrackingTransparencyPermission');
9
+ let trackingResult = 'granted';
7
10
  let trackingPermission = await Storage.getData('TRACKING_PERMISSION');
8
11
  if (!trackingPermission || trackingPermission !== 'granted') {
9
- const { status } = await ExpoTrackingTransparency.requestTrackingPermissionsAsync();
12
+ const { status } = await requestTrackingPermissionsAsync();
10
13
  if (status === 'granted') {
11
14
  Storage.storeData('TRACKING_PERMISSION', 'granted');
12
15
  Networking.sendEvent('action', 'tracking_consent');
@@ -14,13 +17,16 @@ class TrackingTransparency {
14
17
  } else {
15
18
  Storage.storeData('TRACKING_PERMISSION', 'denied');
16
19
  Networking.sendEvent('action', 'tracking_denied');
20
+ trackingResult = 'denied';
17
21
  console.log('Tracking Transparency permission denied');
18
22
  }
19
23
  }
24
+ config.TRACKING_ACTIVE = (trackingResult === 'granted');
25
+ return trackingResult;
20
26
  }
21
27
 
22
28
  async getAdvertisingIdentifier() {
23
- return ExpoTrackingTransparency.getAdvertisingId();
29
+ return getAdvertisingId();
24
30
  }
25
31
  }
26
32