Skip to main content

Installation

This guide shows you how to add the Scandit Data Capture SDK to your existing project.

Prerequisites

  • The latest stable version of React Native CLI and other related tools and dependencies.
  • A project with:
    • minimum node version of 18 or higher.
    • minimum iOS deployment target of 14.0 or higher (15.0 or higher for ID Capture)
    • an Android project with target SDK version 23 (Android 6, Marshmallow) or higher (version 24 or higher for ID Capture)
  • A valid Scandit Data Capture SDK license key. You can sign up for a free test account.
tip

Android devices running the Scandit Data Capture SDK need to have a GPU or the performance will drastically decrease.

Internal Dependencies

Certain Scandit Data Capture SDK modules have package dependencies.

ModuleDependenciesOptional Dependencies
scandit-react-native-datacapture-coreNoneNone
scandit-react-native-datacapture-barcodescandit-react-native-datacapture-coreNone
scandit-react-native-datacapture-idscandit-react-native-datacapture-corescandit-react-native-datacapture-id-europe-driving-license
scandit-react-native-datacapture-id-aamva-barcode-verification
scandit-react-native-datacapture-id-voided-detection
scandit-react-native-datacapture-parserNoneNone
scandit-react-native-datacapture-labelscandit-react-native-datacapture-core
scandit-react-native-datacapture-barcode
scandit-react-native-datacapture-label-text
scandit-react-native-datacapture-price-label
tip

When using ID Capture or Label Capture, consult the respective module's getting started guides to identify the optional dependencies required for your use case. The modules you need to include will vary based on the features you intend to use.

Please be aware that your license may only cover a subset of Barcode and/or ID Capture features. If you require additional features, contact us.

Get a License Key

  1. Sign up or Sign in to your Scandit account
  2. Create a project
  3. Create a license key

If you have a paid subscription, please reach out to Scandit Support if you need a new license key.

Add the SDK

Choose your preferred installation method below. Installing from the package registry is simpler and recommended for most users, while manual installation gives you more control over the SDK version.

tip

You should always make sure to add the scandit-react-native-datacapture-core plugin, as all other plugins depend on it.

Create a new project

If you do not have a React Native project yet that you'll use, you should create a new one.

react-native init HelloScandit
cd HelloScandit

Install from Package Registry

To add Scandit plugins from the package registry, run the corresponding commands from your project's root folder.

Install the core plugin (required):

yarn add scandit-react-native-datacapture-core

Then add the plugin(s) for your desired functionality:

# For barcode scanning
yarn add scandit-react-native-datacapture-barcode

# For ID capture
yarn add scandit-react-native-datacapture-id

# For label capture
yarn add scandit-react-native-datacapture-label
tip

You can add only the plugins you need as described in the Internal Dependencies section. You can also specify a version @<version>.

Additional steps on iOS

  1. Camera permissions are required to stream the frame source data into various capture modes. You need to set the “Privacy - Camera Usage Description” field in the Info.plist file for iOS.
<key>NSCameraUsageDescription</key>
<string>Access to the camera is required for scanning.</string>

Info file

  1. Then, install the iOS Cocoapods after installing the React Native node_modules:
cd ios && pod install && cd ..

Additional Information

Android Content Providers

On Android, the Scandit SDK uses content providers to initialize the scanning capabilities properly. If your own content providers depend on the Scandit SDK, choose an initOrder lower than 10 to make sure the SDK is ready first.

If not specified, initOrder is zero by default and you have nothing to worry about.

Check the official <provider> documentation.

Camera Permissions

When using the Scandit Data Capture SDK you will want to set the camera as the frame source for various capture modes. On Android, you have to request camera permissions in your own application before starting scanning. To see how you can achieve this, take a look at our samples.

Third-party Licenses

The Scandit Data Capture SDK relies on several third-party, open-source software libraries. Your application must display the license information for these libraries in many cases.

The Scandit SDK provides a convenient API that you can use to fetch the corresponding text and attributions for all third-party software:

  • DataCaptureContext.getOpenSourceSoftwareLicenseInfo()