I have been implementing a barcode scanner app. Everything was working good until today. However, today the app started to detect the barcodes differently. I get the barcode type as 'TEXT' instead of 'QR_CODE'.
My code is like this
barcodeDetected = ({ barcodes }) => {
if (barcodes && barcodes[0].type === 'QR_CODE')) {
....
}
};
render() {
return (
<RNCamera
....
onGoogleVisionBarcodesDetected={this.barcodeDetected }
googleVisionBarcodeType={RNCamera.Constants.GoogleVisionBarcodeDetection.BarcodeType.ALL}>
</RNCamera>
)
}
react-native-camera version that I used is 3.13.1. I checked the source code and saw that after version 2.4.0, onGoogleVisionBarcodesDetected callback uses BarcodeType which includes
|"EMAIL"
|"PHONE"
|"CALENDAR_EVENT"
|"DRIVER_LICENSE"
|"GEO"
|"SMS"
|"CONTACT_INFO"
|"WIFI"
|"TEXT"
|"ISBN"
|"PRODUCT"
|"URL"
So how could it work correctly before? And I also checked some github repositories and saw that some use the higher version than 2.4.0 (also higher than 3.0.0) and their codes are still exactly the same as me.
This is what I get on detection
[{"bounds": {"origin": [Object], "size": [Object]}, "data": "BLAH/BLAH", "rawData": ".........", "type": "TEXT"}]
I was getting the type as 'QR_CODE' a couple of days ago. I made changes in these days and I can't understand what caused this.
What could be the reason for this? Thank you