Skip to content

Open documents using native components on Android & iOS

License

Notifications You must be signed in to change notification settings

rpander93/react-native-document-opener

Repository files navigation

📖 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.

License

MIT