apps-sdk 1.0.69 → 1.0.71

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.69",
3
+ "version": "1.0.71",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,6 +15,7 @@
15
15
  "expo-constants": "^15.4.5",
16
16
  "expo-device": "^5.9.3",
17
17
  "expo-file-system": "^16.0.6",
18
+ "expo-linking": "^6.2.2",
18
19
  "expo-localization": "^14.8.3",
19
20
  "expo-media-library": "^15.9.1",
20
21
  "expo-notifications": "^0.23.0",
@@ -6,6 +6,7 @@ import Utils from "../libraries/Utils";
6
6
  import Networking from "../libraries/Networking";
7
7
  import PayWallLogic from "../libraries/PayWallLogic";
8
8
  import Session from "../libraries/Session";
9
+ import * as Linking from 'expo-linking';
9
10
  import * as config from "../../config";
10
11
 
11
12
  class PayWall extends React.Component {
@@ -121,7 +122,17 @@ class PayWall extends React.Component {
121
122
  return (
122
123
  <BottomSheet visible={visible} onBackButtonPress={onClose} onBackdropPress={onClose}>
123
124
  <View style={styles.bottomNavigationView}>
124
- <WebView style={{flex:1}} source={{ uri: this.paywallData.url }} javaScriptEnabled ref={this.webviewRef} onMessage={this.handleMessage} onError={(err) => {console.log('Error al cargar webview:',err)}} injectedJavaScript={PayWallLogic.paywallJS}/>
125
+ <WebView style={{flex:1}} source={{ uri: this.paywallData.url }} javaScriptEnabled ref={this.webviewRef} onMessage={this.handleMessage} onError={(err) => {console.log('Error al cargar webview:',err)}} injectedJavaScript={PayWallLogic.paywallJS}
126
+ onShouldStartLoadWithRequest={request => {
127
+ console.log('request', request);
128
+ if (request.url !== this.paywallData.url) {
129
+ Linking.openURL(request.url);
130
+ return false;
131
+ } else {
132
+ return true;
133
+ }
134
+ }}
135
+ />
125
136
  </View>
126
137
  </BottomSheet>
127
138
  );
@@ -148,13 +148,13 @@ class Storage {
148
148
  async handleDownloadImageToGallery(imageURI) {
149
149
  try {
150
150
  const { status } = await MediaLibrary.requestPermissionsAsync();
151
- if(status !== 'granted') {
152
- return;
151
+ if(status === 'granted') {
152
+ return await MediaLibrary.createAssetAsync(imageURI);
153
153
  }
154
- return await MediaLibrary.createAssetAsync(imageURI);
155
154
  } catch(error) {
156
155
  console.error('Error al guardar la imagen en la galería:', error);
157
156
  }
157
+ return false;
158
158
  }
159
159
 
160
160
  async getCreations() {
package/types/index.d.ts CHANGED
@@ -89,7 +89,7 @@ declare module 'apps-sdk' {
89
89
  getCreations(): Promise<any>;
90
90
  deleteCreation(dirName: string): Promise<void>;
91
91
  deleteAllCreations(): Promise<void>;
92
- handleDownloadImageToGallery(imageURI: string): Promise<void>;
92
+ handleDownloadImageToGallery(imageURI: string): Promise<string>;
93
93
  handleRequestGalleryPermission(): Promise<string>;
94
94
  setTrackingPermissionGranted(value: boolean): void;
95
95
  }