Sin descripción

android.js 786B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2016 wkh237@github. All rights reserved.
  2. // Use of this source code is governed by a MIT-style license that can be
  3. // found in the LICENSE file.
  4. // @flow
  5. import {
  6. NativeModules,
  7. DeviceEventEmitter,
  8. Platform,
  9. NativeAppEventEmitter,
  10. } from 'react-native'
  11. const RNFetchBlob:RNFetchBlobNative = NativeModules.RNFetchBlob
  12. /**
  13. * Send an intent to open the file.
  14. * @param {string]} path Path of the file to be open.
  15. * @param {string} mime MIME type string
  16. * @return {Promise}
  17. */
  18. function actionViewIntent(path:string, mime:string = 'text/plain') {
  19. if(Platform.OS === 'android')
  20. return RNFetchBlob.actionViewIntent(path, mime)
  21. else
  22. return Promise.reject('RNFetchBlob.actionViewIntent only supports Android.')
  23. }
  24. export default {
  25. actionViewIntent
  26. }