Installation
Depending on what module you need, install one or both of the packages:
yarn add @react-native-documents/picker
yarn add @react-native-documents/viewer
Setting up
The document picker package requires iOS 14 or later. If you use Expo, use Expo SDK >=52 or Expo build properties to update the deploymentTarget
to 14
.
In regular React Native projects, use RN >= 0.76 or update the settings in Xcode.
Expo
These packages cannot be used in "Expo Go" because they require custom native code.
However, you can add custom native code to an Expo app through a development build. That is the officially recommended approach for building Expo apps. See the commands below to do this.
# install the package first
# Build the app locally
expo prebuild --clean
expo run:ios
expo run:android
React Native
Install the package and then run pod install
from the ios directory. Then rebuild your project with Xcode.
The packages support last 3 stable releases of RN, but very likely work with RN 0.73 and up.
If you're using the New Architecture, it's strongly recommended to use the latest stable release of RN.