1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
-
-
-
-
- import {
- NativeModules,
- DeviceEventEmitter,
- Platform,
- NativeAppEventEmitter,
- } from 'react-native'
-
- const RNFetchBlob:RNFetchBlobNative = NativeModules.RNFetchBlob
-
-
- function actionViewIntent(path:string, mime:string = 'text/plain') {
- if(Platform.OS === 'android')
- return RNFetchBlob.actionViewIntent(path, mime)
- else
- return Promise.reject('RNFetchBlob.android.actionViewIntent only supports Android.')
- }
-
- function getContentIntent(mime:string) {
- if(Platform.OS === 'android')
- return RNFetchBlob.getContentIntent(mime)
- else
- return Promise.reject('RNFetchBlob.android.getContentIntent only supports Android.')
- }
-
- function addCompleteDownload(config) {
- if(Platform.OS === 'android')
- return RNFetchBlob.addCompleteDownload(config)
- else
- return Promise.reject('RNFetchBlob.android.addCompleteDownload only supports Android.')
- }
-
-
- export default {
- actionViewIntent,
- getContentIntent,
- addCompleteDownload
- }
|