apps-sdk 1.0.91 → 1.0.93

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/index.js CHANGED
@@ -2,6 +2,10 @@ import {NotificationsPush, Networking, Storage, Session, Utils, PayWallLogic, Ra
2
2
  import PayWall from "./src/components/PayWall";
3
3
 
4
4
  class AppsSDK {
5
+ constructor() {
6
+ Storage.setTrackingPermissionFromStorage();
7
+ }
8
+
5
9
  sobrescribeConsole = () => {
6
10
  try {
7
11
  console.log('Overwriting console.log and console.debug...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.91",
3
+ "version": "1.0.93",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -49,7 +49,7 @@ class PayWall extends React.Component {
49
49
  }
50
50
 
51
51
  async componentDidUpdate(prevProps) {
52
- if (this.props.visible && !prevProps.visible) {
52
+ if (this.props.visible && !prevProps.visible && this.paywallData.url) {
53
53
  this.webviewRef.current.injectJavaScript(PayWallLogic.paywallJS);
54
54
  Networking.sendEvent('scene', 'payment_card', { user_id: Session.getUserID(), card_id: this.getCardID(), scene: 'payment_card' });
55
55
  }
@@ -115,8 +115,10 @@ class PayWall extends React.Component {
115
115
  }
116
116
  }
117
117
  console.log('SDK setHideLoaderAppquiles',event);
118
- const jsHideSpinner = `Appquiles.emitAppEvent(${JSON.stringify(event)});$('.spinner').hide(); true;`;
119
- this.webviewRef.current.injectJavaScript(jsHideSpinner);
118
+ if (this.paywallData.url) {
119
+ const jsHideSpinner = `Appquiles.emitAppEvent(${JSON.stringify(event)});$('.spinner').hide(); true;`;
120
+ this.webviewRef.current.injectJavaScript(jsHideSpinner);
121
+ }
120
122
  }
121
123
 
122
124
  hidePayWall = () => {
@@ -131,6 +133,12 @@ class PayWall extends React.Component {
131
133
  config.DEBUG_MODE && console.log('PayWallLogic.paywallJS:', PayWallLogic.paywallJS);
132
134
  config.DEBUG_MODE && console.log('PayWallLogic.paywallJS type:', typeof PayWallLogic.paywallJS);
133
135
  }
136
+
137
+ if (!this.paywallData.url) {
138
+ config.DEBUG_MODE && console.log('PayWallLogic: paywallData no tiene url para este type / keyword -> ' + type + ' / ' + keyword);
139
+ return null;
140
+ }
141
+
134
142
  return (
135
143
  <BottomSheet visible={visible} onBackButtonPress={onClose} onBackdropPress={onClose}>
136
144
  <View style={styles.bottomNavigationView}>
@@ -11,7 +11,6 @@ class AdJust {
11
11
  async initialize() {
12
12
  const adjustEnvironment = config.ADJUST.ENVIRONMENT === 'SANDBOX' ? AdjustConfig.EnvironmentSandbox : AdjustConfig.EnvironmentProduction;
13
13
  const adjustLogLevel = config.ADJUST.LOG_LEVEL === 'VERBOSE' ? AdjustConfig.LogLevelVerbose : AdjustConfig.LogLevelSuppress;
14
- await storage.setTrackingPermissionFromStorage()
15
14
  console.log("Initializing AdJust. Environment: " + adjustEnvironment + ", Log level: " + adjustLogLevel + ", config.TRACKING_ACTIVE: " + config.TRACKING_ACTIVE);
16
15
  try {
17
16
  const adjustConfig = new AdjustConfig(config.ADJUST.ADJUST_TOKEN, adjustEnvironment);