apps-sdk 1.0.29 → 1.0.30

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
@@ -1,4 +1,4 @@
1
- import {NotificationsPush, Networking, Storage, Session, Utils, PayWall} from "./src/libraries";
1
+ import {NotificationsPush, Networking, Storage, Session, Utils, PayWall, PayWall2} from "./src/libraries";
2
2
 
3
3
  class AppsSDK {
4
4
  initializePushNotifications = async() => {
@@ -18,5 +18,6 @@ export default {
18
18
  storage: Storage,
19
19
  session: Session,
20
20
  utils: Utils,
21
- paywall: PayWall
21
+ paywall: PayWall,
22
+ paywall2: PayWall2
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -19,6 +19,7 @@
19
19
  "expo-notifications": "^0.23.0",
20
20
  "expo-sharing": "^11.10.0",
21
21
  "react-native": "^0.73.2",
22
+ "react-native-btr": "^2.2.1",
22
23
  "react-native-webview": "^13.8.1"
23
24
  },
24
25
  "types": "./types/index.d.ts"
@@ -1,15 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import { WebView } from 'react-native-webview';
3
3
  import { BottomSheet } from 'react-native-btr';
4
4
  import Utils from "./Utils";
5
5
  import { StyleSheet, View, Dimensions } from 'react-native';
6
6
 
7
- class PayWall extends React.Component {
8
- constructor(props) {
9
- super(props);
10
- this.state = { isVisible: false, url: null };
11
- }
12
-
7
+ export default class PayWall extends React.Component {
13
8
  webviewRef = React.createRef();
14
9
  bottomSheetRef = React.createRef();
15
10
 
@@ -27,17 +22,9 @@ class PayWall extends React.Component {
27
22
  return "window.subInfoInterval = setInterval(() => window.Appquiles && Appquiles.setSubscriptionPlans(" + JSON.stringify(information.subsPlansInfo) + "), 300);";
28
23
  }
29
24
 
30
- show = (url) => {
31
- this.setState({ isVisible: true, url: url });
32
- }
33
-
34
- hide = () => {
35
- this.setState({ isVisible: false, url: null });
36
- }
37
-
38
25
  render() {
39
26
  return (
40
- this.state.isVisible &&
27
+ this.props.isVisible &&
41
28
  <View style={styles.container}>
42
29
  <BottomSheet
43
30
  ref={this.bottomSheetRef}
@@ -53,7 +40,7 @@ class PayWall extends React.Component {
53
40
  >
54
41
  <WebView
55
42
  style={styles.webview}
56
- source={{ uri: this.state.url }}
43
+ source={{ uri: this.props.url }}
57
44
  javaScriptEnabled
58
45
  ref={this.webviewRef}
59
46
  onMessage={this.handleMessage}
@@ -74,5 +61,3 @@ const styles = StyleSheet.create({
74
61
  flex: 1,
75
62
  }
76
63
  });
77
-
78
- export default new PayWall();
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { BottomSheet } from 'react-native-btr';
3
+ import { WebView } from 'react-native-webview';
4
+
5
+ export default function PayWall2({ visible, onClose }) {
6
+ return (
7
+ <BottomSheet
8
+ visible={visible}
9
+ onBackButtonPress={onClose}
10
+ onBackdropPress={onClose}
11
+ >
12
+ <WebView source={{ uri: 'https://www.google.es' }} />
13
+ </BottomSheet>
14
+ );
15
+ }
@@ -4,4 +4,5 @@ export { default as Storage } from './Storage';
4
4
  export { default as Session } from './Session';
5
5
  export { default as Utils } from './Utils';
6
6
  export { default as PayWall } from './PayWall';
7
+ export { default as PayWall2 } from './PayWall2';
7
8
 
package/types/index.d.ts CHANGED
@@ -83,11 +83,6 @@ declare module 'apps-sdk' {
83
83
  registerForPushNotificationsAsync(): Promise<string>;
84
84
  }
85
85
 
86
- export class PayWall {
87
- show(url: string): void;
88
- hide(): void;
89
- }
90
-
91
86
  export class AppsSDK {
92
87
  initializePushNotifications(): Promise<string>;
93
88
  }
@@ -98,7 +93,6 @@ declare module 'apps-sdk' {
98
93
  storage: Storage;
99
94
  session: Session;
100
95
  utils: Utils;
101
- paywall: PayWall;
102
96
  }
103
97
 
104
98
  const Core: AppsSDK;