#install: npm install git+https://github.com/adi1625/react-native-local-barcode-recognizer.git #and link: react-native link react-native-local-barcode-recognizer 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);修改源码文件,修复二维码识别率过低的问题,添加了ts类型
优化方法参照 文章
修复了ios无法编译的问题。 文章
| 方法 | 参数 |
|---|---|
| decode | (base64编码,options)=> Promise<string> |
| 名称 | 描述 |
|---|---|
| codeTypes | [aztec,ean13, ean8, qr, pdf417, upc_e, datamatrix, code39, code93, interleaved2of5, codabar, code128, maxicode, rss14, rssexpanded, upc_a, upc_ean] |