rn-qr-generator
rn-qr-generator copied to clipboard
Detect not working on Android [QR on slip]
Hello!
I am trying to use qrcode detect. It works fine on ios, but I get nothing on android, like this.
{"type": "", "values": []}
Could you help me? Here's the code:
const openImageFromGallery = async () => {
try {
setIsCloseCamera(true)
const image = await ImagePicker.openPicker({
width: width,
height: height,
mediaType: 'photo',
})
const base64ImgId = await RNFS.readFile(image.path, 'base64')
const response = await RNQRGenerator.detect({
uri: image.path,
base64: base64ImgId,
})
if (!_.isEmpty(response.values)) {
setCode([{ displayValue: response.values[0] }])
} else {
setIsCloseCamera(false)
setIsShowPopupQrInvalid(!isShowPopupQrInvalid)
}
} catch (error) {
console.error('🚀 ~ openImageFromGallery ~ error', error)
return
}
}
this QR code I scan
Hi @kittipat3699. What is device model and OS version?
Same. It works fine on iOS. But does not work on android (for these kinds of photographed images only). I am using a Samsung A80 device with Android 11 @gevgasparyan
bump
Is there any other library that can replace
The barcode in the photo cannot be recognized
Hi @kittipat3699
This module uses zxing
lib on android.
If you try to decode the image with zxing online decoder it will also be empty. Seems the issue is with decoder.
Will let you know when I find another solution for that.
Thanks