1.0.7 • Published 4 years ago
@apl-common/react-native-kaicom-scanner v1.0.7
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()