Add the SDK to Your App#

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

Prerequisites#

Note

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

Get a License Key#

  1. If you don’t have a scandit account yet, create a free test account at ssl.scandit.com.

  2. Sign in to your account at ssl.scandit.com/sessions/new.

  3. Select “License Keys” from the left-hand menu

  4. If you don’t have a license key for your app yet, click “Create native SDK license key” and enter the bundle ID for your project.

  5. Copy the license key.

Should you have a paid subscription, please reach out to support@scandit.com if you need a new license key.

Add the SDK#

Currently we support adding the Scandit Data Capture SDK React Native plugins to your project in two ways. The simplest way is to use the npm registry, alternatively you can manually download the plugins and add them to your project.

Note

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

1. Create a new project (optional)#

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

2a. Add the Scandit Data Capture SDK from the npm registry#

To add our plugins from the npm registry, you can run these commands from your project’s root folder. In the following snippet we’re adding ScanditBarcodeCapture API

yarn add scandit-react-native-datacapture-core
yarn add scandit-react-native-datacapture-barcode

Note

You can also specify a version @<version>.

2b. Add the Scandit Data Capture SDK manually#

After you download the archive containing all the plugins at ssl.scandit.com/sdk, unzip the archive. It includes the available React Native plugins, including the scandit-react-native-datacapture-core plugin that all other plugins depend on.

First add scandit-react-native-datacapture-core plugin:

yarn add <path to scandit-react-native-datacapture-core plugin>

Once this is done, you can continue with adding the plugin for your desired functionality, e.g. for barcode capture, add the scandit-react-native-datacapture-barcode plugin:

yarn add <path to scandit-react-native-datacapture-barcode plugin>

3. Additional steps on iOS#

After adding the plugins, you’ll want to make sure they’re added to your iOS project properly:

cd ios && pod install

Additional Information#

  • 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: Run our Sample Apps.

  • Remember that, if you want to use the camera as the frame source for barcode, text and label capture, you need to set the “Privacy - Camera Usage Description” field in the Info.plist file for iOS.

Next steps#

You are now ready to tackle the following guides: