apps-sdk 1.0.197 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.197",
3
+ "version": "1.0.199",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@ class PayWall extends React.Component {
23
23
  };
24
24
  this.maxRetries = 50;
25
25
  this.retryInterval = 1000;
26
- this.bottomsheet = typeof(props.bottomsheet) === 'undefined' ? false : props.bottomsheet;
26
+ this.bottomsheet = typeof(props.bottomsheet) === 'undefined' ? true : props.bottomsheet;
27
27
  }
28
28
 
29
29
  componentDidMount() {
@@ -302,7 +302,7 @@ class PayWall extends React.Component {
302
302
  {content}
303
303
  </BottomSheet>
304
304
  ) : (
305
- content
305
+ visible ? content : null
306
306
  );
307
307
  }
308
308
  }
@@ -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
- config.DEBUG_MODE && console.log('Initializing Adapty with apiKey: ' + apiKey || config.ADAPTY.APP_KEY);
10
- await adapty.activate(apiKey || config.ADAPTY.APP_KEY, {
11
- customerUserId: Session.getUserID(),
12
- logLevel: config.ADAPTY.LOG_LEVEL,
13
- mediaCache: {
14
- memoryStorageTotalCostLimit: 100 * 1024 * 1024, // 100MB
15
- memoryStorageCountLimit: 2147483647, // 2^31 - 1
16
- diskStorageSizeLimit: 100 * 1024 * 1024, // 100MB
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.error('Error initializing Adapty:', error);
26
+ console.warn('Error initializing Adapty:', error);
22
27
  }
23
28
  }
24
29