skip to Main Content

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


  1. Chosen as BEST ANSWER

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


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search