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

[Question] Not work on iphone :( #974

Open
Maverik1408 opened this issue Jan 20, 2025 · 2 comments
Open

[Question] Not work on iphone :( #974

Maverik1408 opened this issue Jan 20, 2025 · 2 comments

Comments

@Maverik1408
Copy link

Maverik1408 commented Jan 20, 2025

Describe the Question
Hi, i create a simple page for scanning the barcode, but on iphone not works

Link to stackoverflow
Please raise this question in stackoverflow.com for faster answer and add the link here.

Context about your web application
Where are you using this and how. It'd be helpful if you provide your usage code example

<html>
<head>
    <title>Html-Qrcode Demo</title>
<body>
    <div id="qr-reader" style="width:500px"></div>
    <div id="qr-reader-results"></div>
</body>
<script src="https://unpkg.com/html5-qrcode" type="text/javascript"></script>
<script>
    function docReady(fn) {
        // see if DOM is already available
        if (document.readyState === "complete"
            || document.readyState === "interactive") {
            // call on next available tick
            setTimeout(fn, 1);
        } else {
            document.addEventListener("DOMContentLoaded", fn);
        }
    }

    docReady(function () {
        var resultContainer = document.getElementById('qr-reader-results');
        var lastResult, countResults = 0;
        function onScanSuccess(decodedText, decodedResult) {
            if (decodedText !== lastResult) {
                ++countResults;
                lastResult = decodedText;
                // Handle on success condition with the decoded message.
                alert(decodedText);
                console.log('Scan result ${decodedText}', decodedResult);
            }
        }


        function onScanFailure(error) {
          // handle scan failure, usually better to ignore and keep scanning.
          // for example:
          alert(error);
        }

        var html5QrcodeScanner = new Html5QrcodeScanner(
            "qr-reader", { fps: 10, qrbox: 250 });
        html5QrcodeScanner.render(onScanSuccess);
    });
</script>
</head>
</html>

Optional, Environment (please complete the following information):

  • Device: [Iphone 8]
  • OS: [IOS 16.7.10]
  • Browser [chrome, safari]
  • Version [e.g. 22]

this is my code, and on android device works fine but iphone no!! we can help me, If I understand correctly it should be compatible

@Maverik1408 Maverik1408 changed the title [Question] [Question] Not work on iphone :( Jan 20, 2025
@Maverik1408
Copy link
Author

Help me? Please? We work on iPhone?

@meilechwieder
Copy link

for me it works on iphone on big qr codes, but not on small.

So i have small qr code (75px hight) and it woudln't scan it but bigger ones would work fine.

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