Installation
Setting up expo-document-scanner in your project is straightforward. Because it relies on native modules, there are a few platform-specific steps handled automatically by Expo.
Prerequisites
- React Native 0.73 or higher
- Expo SDK 50 or higher (if using Expo)
react-native-nitro-modules
Installing the Package
Using npm:
Using Yarn:
Using Expo CLI:
Setup for Expo Managed Workflow
Since this library uses native code (VisionKit on iOS and ML Kit on Android), you cannot use it with Expo Go. You must create a development build.
1. Add Plugins (If necessary)
In your app.json or app.config.js, ensure you have the required permissions. The plugin usually handles this automatically, but if you need to specify camera permissions manually:
2. Create a Development Build
Run the following command to create your development build:
Setup for Bare React Native
If you are not using Expo, you need to install the CocoaPods dependencies for iOS:
For Android, auto-linking will handle the native dependencies. Just ensure your minSdkVersion is at least 24 in android/build.gradle.
Now you're ready to move on to the Quick Start guide!