apps-sdk 1.0.196 → 1.0.197

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.196",
3
+ "version": "1.0.197",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,6 +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
27
  }
27
28
 
28
29
  componentDidMount() {
@@ -268,35 +269,41 @@ class PayWall extends React.Component {
268
269
  }
269
270
  }
270
271
 
271
- return (
272
+ const content = (
273
+ <View style={styles.bottomNavigationView}>
274
+ {this.state.htmlContent ? (
275
+ <WebView
276
+ style={{ flex: 1 }}
277
+ originWhitelist={['*']}
278
+ source={{ html: this.state.htmlContent }}
279
+ javaScriptEnabled
280
+ ref={this.webviewRef}
281
+ onMessage={this.handleMessage}
282
+ onError={(err) => { console.log('Error al cargar webview:', err) }}
283
+ // injectedJavaScript={PayWallLogic.paywallJS}
284
+ allowsInlineMediaPlayback={true}
285
+ mediaPlaybackRequiresUserAction={false}
286
+ onShouldStartLoadWithRequest={request => {
287
+ if (request.url !== 'about:blank' && request.url !== this.paywallData.url) {
288
+ Networking.sendEvent('action', 'click_link', { url: request.url });
289
+ Linking.openURL(request.url);
290
+ return false;
291
+ } else {
292
+ return true;
293
+ }
294
+ }}
295
+ />
296
+ ) : null}
297
+ </View>
298
+ );
299
+
300
+ return this.bottomsheet ? (
272
301
  <BottomSheet visible={visible}>
273
- <View style={styles.bottomNavigationView}>
274
- {this.state.htmlContent ? (
275
- <WebView
276
- style={{ flex: 1 }}
277
- originWhitelist={['*']}
278
- source={{ html: this.state.htmlContent }}
279
- javaScriptEnabled
280
- ref={this.webviewRef}
281
- onMessage={this.handleMessage}
282
- onError={(err) => { console.log('Error al cargar webview:', err) }}
283
- // injectedJavaScript={PayWallLogic.paywallJS}
284
- allowsInlineMediaPlayback={true}
285
- mediaPlaybackRequiresUserAction={false}
286
- onShouldStartLoadWithRequest={request => {
287
- if (request.url !== 'about:blank' && request.url !== this.paywallData.url) {
288
- Networking.sendEvent('action', 'click_link', { url: request.url });
289
- Linking.openURL(request.url);
290
- return false;
291
- } else {
292
- return true;
293
- }
294
- }}
295
- />
296
- ) : null}
297
- </View>
302
+ {content}
298
303
  </BottomSheet>
299
- );
304
+ ) : (
305
+ content
306
+ );
300
307
  }
301
308
  }
302
309