teslamotors / react-native-camera-kit

A high performance, easy to use, rock solid camera library for React Native apps.
MIT License
2.46k stars 585 forks source link

scanBarcode={false} ios not working #476

Open yellowh2art opened 2 years ago

yellowh2art commented 2 years ago

Issue Description

Barcode is read even if scanBarcode value is set to false in ios

Steps to Reproduce / Code Snippets / Screenshots

<CameraScreen
showFrame={false} // Show/hide scan frame scanBarcode={false} // Can restrict for the QR Code only laserColor={'blue'} // Color can be of your choice frameColor={'yellow'} // If frame is visible then frame color colorForScannerFrame={'black'} // Scanner Frame color onReadCode={(event) => onBarcodeScan(event.nativeEvent.codeStringValue) //Alert.alert('QR code found') } />


Environment

yellowh2art commented 2 years ago

I want to block reading the barcode until success or failure is returned after verifying the value after reading the barcode.

crobinson42 commented 1 year ago

Use a hook const local = useRef({ reading: false}) and set local.current.reading = true in the onReadCode() handler to block multiple reads from triggering.

agestaun commented 1 year ago

Same issue: I know it can be prevented using a ref, but that shouldn't be like that.