Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: Barcode Scanning Fails After Multiple Scans #696

Open
aravind3566 opened this issue Feb 6, 2025 · 0 comments
Open

Issue: Barcode Scanning Fails After Multiple Scans #696

aravind3566 opened this issue Feb 6, 2025 · 0 comments

Comments

@aravind3566
Copy link
Contributor

aravind3566 commented Feb 6, 2025

I'm encountering an issue where the barcode scanner fails to read QR codes consistently after the second or third scan. It works fine initially, but after a few successful scans, the onReadCode event stops triggering, and the QR codes are no longer detected.

const onBarcodeScan = (event) => {
    resetTimer();
    cancelAlertToast();
    const urlString = event?.nativeEvent?.codeStringValue;

    if (!isScanningAllowed) {
        return;
    } else {
        setScanningAllowed(false);
        ProcessQrCode(urlString);
    }}
{
    isCameraActive && cameraPermission ? (
        <View style={{ flex: 1 }}>
            <Camera
                ref={(ref) => (cameraRef.current = ref)}
                flashMode="auto"
                focusMode="off"
                zoomMode="on"
                style={[styles.camerascreen]}
                torchMode={torchswitch}
                cameraType={!cameraState ? CameraType.Back : CameraType.Front}
                scanBarcode={true}
                resizeMode="cover"
                onReadCode={(event) => onBarcodeScan(event)}
            />
        </View>
    ) : (
        <View></View>
    )
}

Expected behavior
The scanner should consistently detect QR codes regardless of how many scans are performed.

Observed Behavior

  1. First scan works perfectly.
  2. Second or third scan starts failing randomly.
  3. onReadCode doesn’t trigger even when QR code is clearly visible.

Smartphone (please complete the following information):

  • Device: Samsung Tab A
  • OS: Android 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant