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

Camera does not capture QR on iOS #353

Open
mahtoid opened this issue Jun 28, 2023 · 6 comments
Open

Camera does not capture QR on iOS #353

mahtoid opened this issue Jun 28, 2023 · 6 comments

Comments

@mahtoid
Copy link

mahtoid commented Jun 28, 2023

Hello,

I am running react-qr-reader on a web app. Users have been trying to scan QRs using iOS (w/ Safari and Chrome) and have been reporting that it isn't detecting the QR code to scan.

From the little I have been able to test, there doesn't seem to be any errors or feedback what so ever. I have taken a browse over existing issues regarding iOS, but the website is 'trusted' (active SSL Certification) and works perfectly fine on Windows, Linux and Android. It seems to have intermittent issues with Mac (unable to reproduce myself) but has never worked at all on iOS.

Is there an active solution for this issue?

@Tjerk-Haaye-Henricus
Copy link

Same here

@mosqueradvd
Copy link

Same here. Any updates?

@sebitas
Copy link

sebitas commented Aug 20, 2023

same

@di3upham
Copy link

di3upham commented Sep 6, 2023

same. any updates?

@Patrick-Sherlund
Copy link

Patrick-Sherlund commented Sep 12, 2023

@mahtoid What iOS version are you using? Do you have the version numbers of each browser, etc?

I'm currently using iOS 16.1.1 on the latest version of Chrome / Safari and have no issues. Here's my QrReader component:

const [scanResult, setScanResult] = useState(null);

<QrReader
          onResult={(result) => {
            setScanResult((oldState) => {
              if (oldState?.getText() !== result?.getText()) {
                return result;
              }
            });
          }}
          scanDelay={250}
          constraints={{
            facingMode: 'environment',
            width: { max: 2000, min: 480 },
          }}
        />

@gregg-cbs
Copy link

gregg-cbs commented Sep 24, 2023

The docs are wrong with the result.text. I also have no idea why they default the camera to the selfie camera, that makes no sense, the below fixes that too.

You can copy and paste this for a good working start:

<QrReader
  constraints={{
    aspectRatio: "1",
    facingMode: "environment"
  }}
  scanDelay={250}
  onResult={(result, error) => {
    if (!!result) {
      console.log(result.getText())
    }
  }}
  ViewFinder={() => (
    <div
      style={{
        position: "absolute",
        top: "0",
        left: "0",
        right: "0",
        bottom: "0",
        zIndex: 10
      }}
    >overlay</div>
  )}
  videoContainerStyle={{}}
  videoStyle={{}}
/>

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

7 participants