This is a React Native library that opens documents using their native components on Android (via a File Provider) and iOS (via a UIDocumentInteractionController).
Use yarn to install the library from npm.
yarn add react-native-document-opener
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');
See the contributing guide to learn how to contribute to the repository and the development workflow.