12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
-
-
-
-
- import {
- NativeModules,
- DeviceEventEmitter,
- Platform,
- NativeAppEventEmitter,
- } from 'react-native'
-
- const RNFetchBlob:RNFetchBlobNative = NativeModules.RNFetchBlob
-
-
- function previewDocument(path:string, scheme:string) {
- if(Platform.OS === 'ios')
- return RNFetchBlob.previewDocument('file://' + path, scheme)
- else
- return Promise.reject('RNFetchBlob.openDocument only supports IOS.')
- }
-
-
- function openDocument(path:string, scheme:string) {
- if(Platform.OS === 'ios')
- return RNFetchBlob.openDocument('file://' + path, scheme)
- else
- return Promise.reject('RNFetchBlob.previewDocument only supports IOS.')
- }
-
-
- function excludeFromBackupKey(path:string) {
- return RNFetchBlob.excludeFromBackupKey('file://' + path);
- }
-
- export default {
- openDocument,
- previewDocument,
- excludeFromBackupKey
- }
|