androidreactjsreact-nativeexpo-camera

React Native expo-camera scanning Qr Code but not able to scan Barcode


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!`);
  };

Solution

  • TO Scan Barcode Images just remove barcodeScannerSettings. This resolved my problem .