@apl-common/react-native-kaicom-scanner
v1.0.7
Published
凯立PDA扫描的react native包,目前只实现了开始监听扫描,结束监听扫描的功能,其他的设置项暂时没有实现
Downloads
2
Readme
react-native-kaicom-scanner
Getting started
$ npm i @apl-common/react-native-kaicom-scanner --save
Mostly automatic installation
$ react-native link @apl-common/react-native-kaicom-scanner
Usage
import KaicomScanner, {Result} from "react-native-kaicom-scanner";
import {DeviceEventEmitter} from "react-native";
// TODO: What to do with the module?
// Start
const EVENT_NAME:string = "Scanner";
KaicomScanner.startScan(EVENT_NAME);
let scanListener= DeviceEventEmitter.addListener(EVENT_NAME, async (event:Result) => {/* your code */})
// Stop
KaicomScanner.stopScan();
scanListener.remove()