react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

scanBarcode={false} ios not working

Open yellowh2art opened this issue 2 years ago • 3 comments

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

  • React Native Navigation version: 6.0.11
  • React Native version: 0.68.1
  • Platform(s) (iOS, Android, or both?): IOS
  • Device info (Simulator/Device? OS version? Debug/Release?): device/15.4.1/Debug

yellowh2art avatar Jul 08 '22 16:07 yellowh2art

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

yellowh2art avatar Jul 08 '22 16:07 yellowh2art

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

crobinson42 avatar Mar 06 '23 01:03 crobinson42

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

agestaun avatar Jun 20 '23 14:06 agestaun