react-native-document-opener
v1.0.0
Published
Opens documents with their native previewers on Android and iOS
Downloads
1,970
Readme
📖 react-native-document-opener
This is a React Native library that opens documents using their native components on Android (via a File Provider) and iOS (via a UIDocumentInteractionController).
Installation
Use yarn to install the library from npm.
yarn add react-native-document-opener
Usage
The library exposes two methods that allow you to open documents:
import * as DocumentOpener from 'react-native-document-opener';
// Immediately opens document. Mime type is optional and ignored on iOS
DocumentOpener.openAsync('path/to/local/file.mp4', 'video/mp4');
// Opens options menu (iOS only)
DocumentOpener.presentOptionsAsync('path/to/local/file.mp4');
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.