Skip to main content

React Native Barcode Scanner SDK - Getting Started

Installation

The Scanbot Barcode SDK module is available as an npm package.

You can simply add it to your project by npm install:

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

Android Setup

Scanbot Barcode Scanner SDK Maven Repositories

This React Native module depends on the native Scanbot Barcode Scanner SDK for Android. The Scanbot Barcode Scanner SDK for Android is distributed through our private Maven repositories. Please add these repositories in your android/build.gradle file in the section allprojects > repositories:

allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}

google()
jcenter()

// Scanbot Barcode Scanner SDK Maven repositories:
maven { url 'https://nexus.scanbot.io/nexus/content/repositories/releases/' }
maven { url 'https://nexus.scanbot.io/nexus/content/repositories/snapshots/' }
}
}

iOS Setup

Integration is done via CocoaPods.

The pod RNScanbotBarcodeSDK defines a dependency to the pod ScanbotBarcodeSDKWrapper which contains some wrapper classes and the native Scanbot Barcode SDK iOS Framework.

Run:

$ cd ios/
$ pod install

That is it, no manual linking required anymore! Just open the Xcode workspace (.xcworkspace) and you should be able to build the native Scanbot Barcode SDK linked via CocoaPods.

Permissions

In order to operate correctly an application that utilizes the ScanbotBarcodeScannerSDK module must have all required permissions to your App. Here is a listing of those permissions:

Android (must be added in your android/app/src/main/AndroidManifest.xml file)

  • <uses-permission android:name="android.permission.CAMERA" /> - This permission is used for the camera views.
  • <uses-feature android:name="android.hardware.camera" /> - Camera hardware features.

iOS (must be added in your Info.plist file)

<key>NSCameraUsageDescription</key>
<string>Provide access to the camera to detect barcodes.</string>

Want to scan longer than one minute?

Generate your free "no-strings-attached" Trial License and properly test the Scanbot SDK.

Get your free Trial License

What do you think of this documentation?