Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for React Native

Example code

For barcode scanner usage examples, you can either use the sample app included in the plugin archive, or paste one of the samples below into your index.js file.

Build the sample apps

Make sure react-native-cli is installed

> yarn global add react-native-cli

Install the plugin

Use the React Native CLI to download the plugin module for the sample.

> cd <directory of the sample>
> yarn install

Note: Running yarn install for one of the samples will delete dependencies of the other samples. Therefore, every time you want to run a different sample you have to rerun yarn install on it.

Add Android dependencies

  • Download the Barcode Scanner SDK for Android. It's available from your Scandit Barcode Scanner SDK account at http://account.scandit.com in the Downloads section.
  • Inside the archive you will find a file named ScanditBarcodeScanner.aar . Copy it to <"directory of the sample">/android/libs

Add iOS dependencies

  • Download the Barcode Scanner SDK for iOS. It's available from your Scandit Barcode Scanner SDK account at http://account.scandit.com in the Downloads section.
  • Inside the archive you will find a file named ScanditBarcodeScanner.framework . Copy it to <"directory of the sample">/ios/ScanditSDK

Run the sample

From the directory of the sample, you can run the app with the following commands:

Run the sample on Android

> react-native run-android

Run the sample on iOS

> react-native run-ios