The plugin to recognize the barcode from local image for React Native.
npm install react-native-local-qrcode##I fork it from this repo https://github.com/januslo/react-native-local-barcode-recognizer
##Install:
``bash
#install:
npm install react-native-local-qrcode
#and link:
react-native link react-native-local-qrcode
`
or you may install manually.
##Usage:
Here is the demo (may check the examples folder of source code as well)
`typescript
import ...
import LocalBarcodeRecognizer from 'react-native-local-barcode-recognizer';
const imageBase64 = "data:image/jpeg;base64,/9j/4AA.......";
type Props = {};
export default class App extends Component
render() {
return (
);
}
recoginze = async ()=>{
// Here is the demoe
let result = await LocalBarcodeRecognizer.decode(imageBase64.replace("data:image/jpeg;base64,",""),{codeTypes:['ean13','qr']});
alert(result);
}
}
...
});
`
javascript let result = await LocalBarcodeRecognizer.decode(base64EncodeStringWithSchema,options);
``| name | desc |
|:----:|:----:|
| codeTypes | the codeFormat array, no default values,at last one of follow values needed: aztec ean13 ean8 qr pdf417 upc_e datamatrix code39 code93 interleaved2of5 codabar code128 maxicode rss14 rssexpanded upc_a upc_ean |