apps-sdk 1.0.184 → 1.0.186

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
@@ -58,6 +58,11 @@ export var IMAGE_COMPRESSION = {
58
58
  ACTIVE: true,
59
59
  }
60
60
 
61
+ export const ADAPTY = {
62
+ APP_KEY: 'public_live_OtCmXa0x.O3t2KKlHjAjU73jv0u2u',
63
+ LOG_LEVEL: 'verbose', // 'error', 'warn', 'info', 'verbose'
64
+ }
65
+
61
66
  export var TRACKING_ACTIVE = false;
62
67
 
63
68
  export var TRACKING_ANSWERED = false;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import {NotificationsPush, Networking, Storage, Session, Utils, PayWallLogic, Rating, AdJust, TrackingTransparency, Voice, MixPanel} from "./src/libraries";
1
+ import {NotificationsPush, Networking, Storage, Session, Utils, PayWallLogic, Rating, AdJust, TrackingTransparency, Voice, MixPanel, Adapty} from "./src/libraries";
2
2
  import PayWall from "./src/components/PayWall";
3
3
 
4
4
  class AppsSDK {
@@ -57,5 +57,6 @@ export default {
57
57
  tracking: TrackingTransparency,
58
58
  paywall: PayWall,
59
59
  notifications: NotificationsPush,
60
- voice: Voice
60
+ voice: Voice,
61
+ adapty: Adapty,
61
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.184",
3
+ "version": "1.0.186",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,29 +9,31 @@
9
9
  "author": "ASD",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
+ "@adapty/react-native-ui": "^3.1.0",
12
13
  "@expo/config-plugins": "~9.0.0",
13
14
  "@react-native-async-storage/async-storage": "1.23.1",
14
15
  "@react-native-community/netinfo": "11.4.1",
15
16
  "@react-native-voice/voice": "^3.2.4",
16
17
  "apps-sdk": "^1.0.120",
17
18
  "crypto-es": "^2.1.0",
18
- "expo": "^52.0.28",
19
+ "expo": "~52.0.38",
19
20
  "expo-constants": "~17.0.5",
20
21
  "expo-device": "~7.0.2",
21
22
  "expo-file-system": "~18.0.7",
22
23
  "expo-image-manipulator": "^13.0.6",
23
- "expo-image-picker": "~16.0.4",
24
+ "expo-image-picker": "~16.0.6",
24
25
  "expo-linking": "~7.0.5",
25
26
  "expo-localization": "~16.0.1",
26
- "expo-media-library": "~17.0.5",
27
- "expo-notifications": "~0.29.13",
27
+ "expo-media-library": "~17.0.6",
28
+ "expo-notifications": "~0.29.14",
28
29
  "expo-sharing": "~13.0.1",
29
30
  "expo-speech": "~13.0.1",
30
31
  "expo-store-review": "~8.0.1",
31
32
  "expo-tracking-transparency": "~5.1.1",
32
33
  "franc-min": "^6.2.0",
33
34
  "mixpanel-react-native": "^3.0.8",
34
- "react-native": "0.76.6",
35
+ "react-native": "0.76.7",
36
+ "react-native-adapty": "^3.3.1",
35
37
  "react-native-adjust": "^5.0.2",
36
38
  "react-native-btr": "^2.2.1",
37
39
  "react-native-iap": "^12.13.0",
@@ -0,0 +1,34 @@
1
+ import { adapty } from 'react-native-adapty';
2
+ import * as config from '../../config';
3
+ import {Session} from "./index";
4
+
5
+ class Adapty {
6
+ async initialize(apiKey = null) {
7
+ try {
8
+ config.DEBUG_MODE && console.log('Initializing Adapty with apiKey: ' + apiKey || config.ADAPTY.APP_KEY);
9
+ await adapty.activate(apiKey || config.ADAPTY.APP_KEY, {
10
+ customerUserId: Session.getUserID(),
11
+ logLevel: config.ADAPTY.LOG_LEVEL,
12
+ mediaCache: {
13
+ memoryStorageTotalCostLimit: 100 * 1024 * 1024, // 100MB
14
+ memoryStorageCountLimit: 2147483647, // 2^31 - 1
15
+ diskStorageSizeLimit: 100 * 1024 * 1024, // 100MB
16
+ },
17
+ });
18
+ } catch (error) {
19
+ console.error('Error initializing Adapty:', error);
20
+ }
21
+ }
22
+
23
+ async getPaywallForPlacement(placementID, lang) {
24
+ try {
25
+ config.DEBUG_MODE && console.log('Getting paywall for placement:', placementID, 'and language:', lang);
26
+ return await adapty.getPaywall(placementID, lang);
27
+ } catch (error) {
28
+ console.error('Error getting paywall:', error);
29
+ return null;
30
+ }
31
+ }
32
+ }
33
+
34
+ export default new Adapty();
@@ -9,3 +9,4 @@ export { default as MixPanel } from './MixPanel';
9
9
  export { default as TrackingTransparency } from './TrackingTransparency';
10
10
  export { default as PayWallLogic } from './PayWallLogic';
11
11
  export { default as Voice } from './Voice';
12
+ export { default as Adapty } from './Adapty';
package/types/index.d.ts CHANGED
@@ -187,6 +187,11 @@ declare module 'apps-sdk' {
187
187
  trackEventIfExist(eventKeyword: string, eventData?: object): Promise<void>;
188
188
  }
189
189
 
190
+ export class Adapty {
191
+ initialize(apiKey: string): Promise<void>;
192
+ getPaywallForPlacement(placementID: string, lang: string): Promise<any>;
193
+ }
194
+
190
195
  export class TrackingTransparency {
191
196
  requestTrackingTransparencyPermission(): Promise<string>;
192
197
  getAdvertisingIdentifier(): Promise<string>;
@@ -212,6 +217,7 @@ declare module 'apps-sdk' {
212
217
  paywallLogic : PayWallLogic;
213
218
  notificationsPush : NotificationsPush;
214
219
  voice : Voice;
220
+ adapty : Adapty;
215
221
  }
216
222
 
217
223
  const Core: AppsSDK;