apps-sdk 1.0.32 → 1.0.33

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, PayWall2} from "./src/libraries";
1
+ import {NotificationsPush, Networking, Storage, Session, Utils, PayWall} from "./src/libraries";
2
2
 
3
3
  class AppsSDK {
4
4
  initializePushNotifications = async() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-sdk",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,6 +20,7 @@
20
20
  "expo-sharing": "^11.10.0",
21
21
  "react-native": "^0.73.2",
22
22
  "react-native-btr": "^2.2.1",
23
+ "react-native-safe-area-context": "^4.9.0",
23
24
  "react-native-webview": "^13.8.1"
24
25
  },
25
26
  "types": "./types/index.d.ts"
@@ -1,15 +1,19 @@
1
1
  import React, { useRef, useEffect } from 'react';
2
2
  import { BottomSheet } from 'react-native-btr';
3
3
  import { WebView } from 'react-native-webview';
4
- import {Dimensions} from "react-native";
4
+ import { View } from "react-native";
5
+ import { SafeAreaView } from 'react-native-safe-area-context';
5
6
  import Utils from "./Utils";
6
7
 
7
8
  export default function PayWall({ visible, onClose }) {
8
9
  const webviewRef = useRef(null);
9
10
 
11
+ const getURL = () => {
12
+ return "https://www.google.com";
13
+ }
10
14
 
11
15
  const getPayWallJS = () => {
12
- return "window.subInfoInterval = setInterval(() => window.Appquiles && Appquiles.setSubscriptionPlans(" + JSON.stringify(information.subsPlansInfo) + "), 300);";
16
+ return "";
13
17
  }
14
18
 
15
19
  const handleMessage = (message) => {
@@ -29,28 +33,34 @@ export default function PayWall({ visible, onClose }) {
29
33
  }, [visible]);
30
34
 
31
35
  return (
32
- <BottomSheet
33
- visible={visible}
34
- onBackButtonPress={onClose}
35
- onBackdropPress={onClose}
36
- height={0.9 * Dimensions.get('window').height}
37
- customStyles={{
38
- container: {
39
- flex: 1,
40
- borderTopLeftRadius: 10,
41
- borderTopRightRadius: 10,
42
- }
43
- }}
44
- >
45
- <WebView
46
- style={styles.webview}
47
- source={{ uri: this.props.url }}
48
- javaScriptEnabled
49
- ref={this.webviewRef}
50
- onMessage={handleMessage}
51
- onError={(err) => {console.log('Error al cargar webview:',err)}}
52
- injectedJavaScript={getPayWallJS()}
53
- />
54
- </BottomSheet>
36
+ <SafeAreaView>
37
+ <BottomSheet
38
+ visible={visible}
39
+ onBackButtonPress={onClose}
40
+ onBackdropPress={onClose}
41
+ >
42
+ <View style={styles.bottomNavigationView}>
43
+ <WebView
44
+ style={{flex:1}}
45
+ source={{ uri: getURL() }}
46
+ javaScriptEnabled
47
+ ref={webviewRef}
48
+ onMessage={handleMessage}
49
+ onError={(err) => {console.log('Error al cargar webview:',err)}}
50
+ injectedJavaScript={getPayWallJS()}
51
+ />
52
+ </View>
53
+ </BottomSheet>
54
+ </SafeAreaView>
55
55
  );
56
56
  }
57
+
58
+ const styles = {
59
+ bottomNavigationView: {
60
+ backgroundColor: '#fff',
61
+ width: '100%',
62
+ height: '100%',
63
+ },
64
+ }
65
+
66
+
package/types/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  declare module 'apps-sdk' {
2
2
  import { ComponentType } from 'react';
3
- import { WebViewProps } from 'react-native-webview';
4
3
  import { BottomSheetProps } from 'react-native-btr';
5
4
 
6
5
  export interface SessionData {
@@ -87,13 +86,11 @@ declare module 'apps-sdk' {
87
86
  registerForPushNotificationsAsync(): Promise<string>;
88
87
  }
89
88
 
90
- export interface PayWallProps extends BottomSheetProps {
89
+ export class PayWall {
91
90
  visible: boolean;
92
91
  onClose: () => void;
93
92
  }
94
93
 
95
- export const PayWall: ComponentType<PayWallProps>;
96
-
97
94
  export class AppsSDK {
98
95
  initializePushNotifications(): Promise<string>;
99
96
  }
@@ -104,6 +101,7 @@ declare module 'apps-sdk' {
104
101
  storage: Storage;
105
102
  session: Session;
106
103
  utils: Utils;
104
+ paywall: PayWall;
107
105
  }
108
106
 
109
107
  const Core: AppsSDK;