I am able to scan QR code with expo-camera but not able to scan barcode .handleBarCodeScanned() methos is called for QR code but not for barcode .
My code :
<View style= {{height: 100}}><CameraView
onBarcodeScanned={scanned ? undefined : handleBarCodeScanned}
barcodeScannerSettings={{
barcodeTypes: ["qr", "pdf417","codabar","aztec","datamatrix","code39"],
}}
style={styles.camera}
/>
</View>
const handleBarCodeScanned = ({ type, data }) => {
console.log("barcode scanned");
setScanned(true);
alert(`Bar code with type ${type} and data ${data} has been scanned!`);
};
2
Answers
TO Scan Barcode Images just remove barcodeScannerSettings. This resolved my problem .
Maybe ean13 ? you can try ignore barcodeScannerSettings to accept all types.
By the way, must steady hold, great focus, really hard to detect more than qr code.