apps-sdk 1.0.26 → 1.0.27

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.26",
3
+ "version": "1.0.27",
4
4
  "description": "Apps SDK",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -187,14 +187,12 @@ class Storage {
187
187
  }
188
188
  }
189
189
 
190
- async handleShareFile(url, fileName) {
191
- const fileUri = FileSystem.documentDirectory + fileName;
192
- const { uri: localUri } = await FileSystem.downloadAsync(url, fileUri);
190
+ async handleShareFile(fileName) {
193
191
  if (!(await Sharing.isAvailableAsync())) {
194
192
  alert('Compartir no está disponible en tu plataforma.');
195
- return;
193
+ return false;
196
194
  }
197
- await Sharing.shareAsync(localUri);
195
+ return await Sharing.shareAsync(fileName);
198
196
  }
199
197
  }
200
198
 
package/types/index.d.ts CHANGED
@@ -56,7 +56,7 @@ declare module 'apps-sdk' {
56
56
  getEndpoints(): any;
57
57
  setEvents(events: any): void;
58
58
  sendEvent(eventType: string, eventKeyword:string, eventData?: object): Promise<void>;
59
- }
59
+ }
60
60
 
61
61
  export class Storage {
62
62
  storeData(key: string, value: any): Promise<void>;
@@ -64,9 +64,9 @@ declare module 'apps-sdk' {
64
64
  printAllKeys(): Promise<void>;
65
65
  removeData(key: string): Promise<void>;
66
66
  handleDownloadImage(url: string, filename: string): Promise<void>;
67
- handleShareFile(url: string, filename: string): Promise<void>;
67
+ handleShareFile(filename: string): Promise<boolean>;
68
68
  createCreationsDir(dirName: string): Promise<void>;
69
- handleDownloadImageToCreations(base64Image: string, fileName: string, data: object): Promise<void>;
69
+ handleDownloadImageToCreations(base64Image: string, fileName: string, data: object): Promise<{ directoryUri: string, fileUri: string, fileData: any }>;
70
70
  getCreations(): Promise<any>;
71
71
  deleteCreation(dirName: string): Promise<void>;
72
72
  deleteAllCreations(): Promise<void>;