Skip to content

Dynamsoft/barcode-reader-react-native-samples

Repository files navigation

Dynamsoft Barcode Reader samples for React-Native edition

This repository contains multiple samples that demonstrate how to use the Dynamsoft Barcode Reader React-Native Edition.

Integration Guide For Your Project

API References

There are two ways to use the Dynamsoft Barcode Reader React-Native SDK:

Samples

Sample Name Description
ScanBarcodes_ReadyToUseComponent This sample illustrates the simplest way of using Barcode Scanner API to recognize barcodes from video streaming.
ScanBarcodes_FoundationalAPI This sample illustrates the simplest way of using Foundational API to recognize barcodes from video streaming.
ScanDriversLicense This sample illustrates how to scan drivers' license from video streaming.

How to build and run a sample

  1. Enter a sample folder that you want to try
cd ScanBarcodes_FoundationalAPI

or

cd ScanBarcodes_ReadyToUseComponent

or

cd ScanDriversLicense
  1. Install node modules

Run the following command:

yarn install

or

npm install
  1. Prepare iOS

You must install the necessary native frameworks from CocoaPods to run the application. In order to do this, the pod install command needs to be run as such:

cd ios
pod install

Open the workspace file *.xcworkspace (not .xcodeproj) from the ios directory in Xcode. Adjust Provisioning and Signing settings.

  1. Build and Run
  • Android

Go to your project folder and run the following command:

# using npm
npm run android

# OR using Yarn
yarn android
  • iOS

In the terminal, go to the project folder in your project:

# using npm
npm run ios

# OR using Yarn
yarn ios

If everything is set up correctly, you should see your new app running on your device. This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.

Note

If you want to run Android via Windows, You may encounter some build errors due to the Windows Maximum Path Length Limitation. Therefore, we recommend that you move the project to a directory with a shorter path.

Note

  • The application needs to run on a physical device rather than a simulator as it requires the use of the camera. If you try running it on a simulator, you will most likely run into a number of errors/failures.
  • On iOS, in order to run the React Native app on a physical device you will need to install the ios-deploy library. Afterwards, you can run the react native app from the terminal as such npx react-native run-ios --device assuming it's the only device connected to the Mac.
  • Alternatively on iOS, you can simply open the xcworkspace of the project found in the ios folder using Xcode and run the sample on your connected iOS device from there. The advantage that this offers is that it is easier to deal with the developer signatures for deployment in there.

How to use the new architecture of React Native (Optional)

How to enable new architecture in Android

How to enable new architecture in iOS

License

Contact

https://www.dynamsoft.com/company/contact/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •