react-native-zebra-scanner
Getting started
$ npm install react-native-zebra-scanner --save
Mostly automatic installation
$ react-native link react-native-zebra-scanner
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainApplication.java
- Add
new ZebraScannerPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-zebra-scanner' project(':react-native-zebra-scanner').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zebra-scanner/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':react-native-zebra-scanner')
Usage
; // Check if hardware scanner is availableawait ZebraScanner; // true or false // Add listenerconst scanListener = { // scannedCode is string. '01245234562345' etc.}ZebraScanner// Remove listenerZebraScanner