apps-sdk 1.0.198 → 1.0.199
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/package.json +1 -1
- package/src/libraries/Adapty.js +16 -11
package/package.json
CHANGED
package/src/libraries/Adapty.js
CHANGED
|
@@ -6,19 +6,24 @@ import {createPaywallView} from "react-native-adapty/dist/ui";
|
|
|
6
6
|
class Adapty {
|
|
7
7
|
async initialize(apiKey = null) {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
const isActivated = await this.isActivated();
|
|
10
|
+
if (!isActivated) {
|
|
11
|
+
config.DEBUG_MODE && console.log('Initializing Adapty with apiKey: ' + apiKey || config.ADAPTY.APP_KEY);
|
|
12
|
+
await adapty.activate(apiKey || config.ADAPTY.APP_KEY, {
|
|
13
|
+
customerUserId: Session.getUserID(),
|
|
14
|
+
logLevel: config.ADAPTY.LOG_LEVEL,
|
|
15
|
+
mediaCache: {
|
|
16
|
+
memoryStorageTotalCostLimit: 100 * 1024 * 1024, // 100MB
|
|
17
|
+
memoryStorageCountLimit: 2147483647, // 2^31 - 1
|
|
18
|
+
diskStorageSizeLimit: 100 * 1024 * 1024, // 100MB
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
config.DEBUG_MODE && console.log('Adapty is already activated');
|
|
23
|
+
}
|
|
19
24
|
const profile = await adapty.getProfile();
|
|
20
25
|
} catch (error) {
|
|
21
|
-
console.
|
|
26
|
+
console.warn('Error initializing Adapty:', error);
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
|