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 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.49",
3
+ "version": "1.0.51",
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,14 @@
1
- import { requestTrackingPermissionsAsync } from 'expo-tracking-transparency';
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
 
package/types/index.d.ts CHANGED
@@ -112,6 +112,7 @@ declare module 'apps-sdk' {
112
112
 
113
113
  export class TrackingTransparency {
114
114
  requestTrackingTransparencyPermission(): Promise<string>;
115
+ getAdvertisingIdentifier(): Promise<string>;
115
116
  }
116
117
 
117
118
  export class AppsSDK {