React Native 从本地图像识别条形码的插件
npm install @arlenwang/react-native-local-barcode-recognizer# React native 本地二维码识别器
bash
#install:
npm install git+https://github.com/du6688/react-native-local-barcode-recognizer.git#and link:
react-native link react-native-local-barcode-recognizer
`用法:
`typescript
import LocalBarcodeRecognizer from 'react-native-local-barcode-recognizer';const imageBase64 = "data:image/jpeg;base64,/9j/4AA.......";
let result = await LocalBarcodeRecognizer.decode(imageBase64.replace("data:image/jpeg;base64,",""), {
codeTypes: ['ean13', 'qr']
});
console.log(result);
``优化方法参照 文章