Skip to main content

Installing the React Native Barcode Scanner SDK

To install the Barcode Scanner SDK, run the following in your root project folder:

npm install react-native-scanbot-barcode-scanner-sdk

Integration with Expo​

Integration with Expo is possible only when using a Development Build, not Expo Go. The project is configurable using our config plugin or by manually configuring the native projects.

To utilize the plugin, add the following in your app config file:

"plugins": [
[
"react-native-scanbot-barcode-scanner-sdk",
{
"iOSCameraUsageDescription": "Barcode Camera permissions",
"androidCameraPermission": true,
"androidCameraFeature": true,
"mavenURLs": true
}
]
],
  • iOSCameraUsageDescription: Adds NSCameraUsageDescription in Info.plist. The permission can also be added via Expo Permissions
  • androidCameraPermission: Adds android.permission.CAMERA permission in AndroidManifest.xml. The permission can also be added via Expo Permissions
  • androidCameraFeature: Adds android.hardware.camera feature in AndroidManifest.xml
  • mavenURLs: Adds Scanbot Barcode Scanner SDK Maven URLs for Android local development. These URLs are already included in our package's build.gradle, but need to be added due to how Expo starts the Android app.
  • podfileSPMHookEnabled: Adds a hook to the Podfile to enable Swift Package Manager support for older versions of React Native 0.87. If you are using React Native 0.87 or newer, you can remove this hook from your Podfile.

iOS SPM Support​

Since the CocoaPods trunk repo is going to be deprecated, we recommend using Swift Package Manager (SPM) for iOS projects. React Native 0.87+ supports SPM out of the box, so no additional configuration is needed for these versions. However, for older versions of React Native, a hook is needed in the Podfile to enable SPM support.

post_install do |installer|
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
)
scanbot_spm(installer)
end

The scanbot_spm hook adds the Scanbot iOS SDK as a Swift Package dependency to your project. This is required for the Scanbot SDK to work properly.

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license

On this page