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

Compatibility - [IOS] [Chrome , Safari] - Iphones aren't reading barcode #915

Open
diegobustosk opened this issue Apr 18, 2024 · 1 comment

Comments

@diegobustosk
Copy link

Describe the bug
A clear and concise description of what the bug is.

  • The Barcode reader is working really good in Android devices, but is not scanning in any IOS devices. It renders but it never gets the Barcode Code.

Describe the browser:

  • OS: IOS
  • Browser Chrome, Safari
  • Version [e.g. 22]

Screenshots
image
image

import { Html5QrcodeScanner, Html5QrcodeScanType } from 'html5-qrcode'; import { useEffect, useRef } from 'react'; const Html5QrcodePlugin = (props) => { const scannerRef = useRef(null); // useRef para mantener la referencia del escáner const qrcodeRegionId = "html5qr-code-full-region"; // ID del contenedor del escáner useEffect(() => { // Solo se ejecuta una vez, ya que el array de dependencias está vacío if (!scannerRef.current) { scannerRef.current = new Html5QrcodeScanner( qrcodeRegionId, { fps: props.fps, qrbox: props.qrbox, aspectRatio: props.aspectRatio, disableFlip: props.disableFlip, focusMode: "continuous", rememberLastUsedCamera: true, supportedScanTypes: [Html5QrcodeScanType.SCAN_TYPE_CAMERA], experimentalFeatures: { useBarCodeDetectorIfSupported: true }, willReadFrequently: true, advanced: [{ zoom: 2.0 }] }, props.verbose ); } const startScanner = () => { scannerRef.current.render( props.qrCodeSuccessCallback, props.qrCodeErrorCallback ); }; setTimeout(() => { startScanner(); }, 0); return () => { scannerRef.current.clear().catch((error) => { console.error("Failed to clear html5QrcodeScanner.", error); }); }; }, []); return <div id={qrcodeRegionId} />; }; export default Html5QrcodePlugin;

{showScanner && ( <Html5QrcodePlugin fps={10} qrbox={250} disableFlip={false} qrCodeSuccessCallback={onNewScanResult} /> )}

@mwcz195
Copy link

mwcz195 commented May 6, 2024

We're facing the same problem.
Code recognition success rate on iPhone 13 and 15 models is very low (less than 10%), while on android devices, the recognition is very fast.
iPhone 13 Pro has 3 lens. And when you do a close-up scan, iPhone will automatically switch lens to make the capture clear. However, the recognition is still not happening.
iPhone 15 has two lens. When you do a very close-up scan, the image is blurred. There is no close-up lens available to make the capture clear (even with native iOS camera app). You have to keep the camera at a medium distance to make the image clear
The initial test suggests it may be more related to iOS camera & scanning library integration issues, and less a lens-switch issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants