mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
4.97k stars 969 forks source link

scanning not working on any Iphone device #454

Closed hraza111 closed 1 year ago

hraza111 commented 2 years ago

Hello, I have used your library and use same code. it works perfect on PC and android devices but not working in iphone mobiles with any version. Thanks in advance

drvolcano commented 2 years ago

I had the same issue, but I could fix it by messing with my HTTPS setting. Now running fine with Blazor Webassembly and Nginx with iPad and iPhone

erikmillergalow commented 2 years ago

I had the same issue, but I could fix it by messing with my HTTPS setting. Now running fine with Blazor Webassembly and Nginx with iPad and iPhone

Can you explain how you set this up? Thanks!

drvolcano commented 2 years ago

Can you explain how you set this up? Thanks!

Still trying to figure out, how to get everything else running, so I sadfully dont have a 100% working recipe right now. I used both tutorials here as a start, maybe this helps https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-6.0 https://www.codeproject.com/Articles/5269965/Deploying-Blazor-Server-side-to-the-Linux-Distro-U

drvolcano commented 2 years ago

Here as sample config of my NGINX, works fine for me, but use it at your own risk:

sudo nano /etc/nginx/sites-available/default

` server { listen 80; listen [::]:80; server_name stux02;

    add_header X-Frame-Options "SAMEORIGIN";

    location / {
            proxy_pass                      http://localhost:5000;
            proxy_http_version              1.1;
            proxy_set_header                Upgrade $http_upgrade;
            proxy_set_header                Connection keep-alive;
            proxy_set_header                Host $host;
            proxy_cache_bypass              $http_upgrade;
            proxy_set_header                X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header                X-Forwarded-Proto $scheme;
    }

}

server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name stux02;

    ssl_certificate           /etc/ssl/certs/testCert.crt;
    ssl_certificate_key       /etc/ssl/certs/testCert.key;
    ssl_session_timeout       1d;
    ssl_protocols             TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;
    ssl_ciphers               ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE->
    ssl_session_cache         shared:SSL:10m;
    ssl_session_tickets       off;
    ssl_stapling              off;

    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options "SAMEORIGIN";

    location / {
            proxy_pass                      http://localhost:5000;
            proxy_http_version              1.1;
            proxy_set_header                Upgrade $http_upgrade;
            proxy_set_header                Connection keep-alive;
            proxy_set_header                Host $host;
            proxy_cache_bypass              $http_upgrade;
            proxy_set_header                X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header                X-Forwarded-Proto $scheme;
    }

}

`

aiso-net commented 2 years ago

I have the same issue, I tried three different iOS devices running latest version of iOS 15.x and none can scan any barcode type using either front or back camera with Safari. I can see the viewfinder in the scan area but it never registers/scans. Site has HTTPs but that should not have to do with anything running locally within the browser.

ROBERT-MCDOWELL commented 2 years ago

first of all, try the html5qrocodeScanner example witht the required option for mobiles, if it works then you have a code problem for the html5Qrcode class @drvolcano html5Qrcode is a client side application, not server side.... btw I'm using html5-qrcode with an iphone 6s IOS 15.6 everyday scanning thaousands of QR codes...

apotekernet commented 2 months ago

@ROBERT-MCDOWELL can you scan CODE_128? I can scan QR Code with iOS+Safari (or chrome). But I can't scan anything other than QR Code. For example CODE_128 or EAN_13 doesn't work.

This is my config:

const config = { fps: 10, qrbox: { width: 250, height: 250 }, supportedFormats: [ Html5QrcodeSupportedFormats.CODE_128, Html5QrcodeSupportedFormats.CODE_39, Html5QrcodeSupportedFormats.EAN_13 ] };

With the same code, on Android+Chrome I can scan a QR Code or barcode C128 or EAN13. iPhone only scan QR Code. Any suggestion? Thanks

ROBERT-MCDOWELL commented 2 months ago

@apotekernet never tried other than QrCode, If I recall well there was already an issue on this subject, try to search on opened and closed issues CODE_128 you ll find some matter, don' t remember if it was solved and how.