@apl-common/react-native-kaicom-scanner

凯立PDA扫描的react native包,目前只实现了开始监听扫描,结束监听扫描的功能,其他的设置项暂时没有实现

Usage no npm install needed!

<script type="module">
  import aplCommonReactNativeKaicomScanner from 'https://cdn.skypack.dev/@apl-common/react-native-kaicom-scanner';
</script>

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()