Open mebjas opened 3 years ago
Hi @mebjas
I will check this issue.
Regards,
Same problem with Safari (or Chrome) on an iPhone with iOS 15 (currently on 15.2 for me). This remembers as intended on an Android device but not on an iPhone.
Observed the same. @denguyen-tvit are you actively working on a PR.
Edit: found a way to make it work:
@mebjas I checked around and currently don't have idea to remember camera permission on iPhone
This seems to be related to underlying issues with WebKit with bugs reported here: https://bugs.webkit.org/show_bug.cgi?id=220416 https://bugs.webkit.org/show_bug.cgi?id=215884
This demo from wwdc2021 is relevant and specifically mentions getUserMedia starting at 12:35 https://developer.apple.com/videos/play/wwdc2021/10032/
And documentation on the new APIs: https://developer.apple.com/documentation/webkit/wkpermissiondecision/
We also have a new API to allow you to decide when and how to prompt the user for camera and microphone permissions when working with web content. Once you have obtained user permissions for the camera and microphone via normal entitlements and prompts, you can decide if the permission prompts should be shown. You can use this to implement your own prompt or remember the users' previous response for web content you control and trust.
I just ran into this issue myself. I was wondering if there's any progress with remembering permissions on iOS; asking our users to give camera permissions every time the app is restarted is not very desirable.
It's not supported on iOS. It's a platform limitation will share more details on this thread soon.
On Thu, Dec 8, 2022, 22:36 Nick Versteeg @.***> wrote:
I just ran into this issue myself. I was wondering if there's any progress with remembering permissions on iOS; asking our users to give camera permissions every time the app is restarted is not very desirable.
— Reply to this email directly, view it on GitHub https://github.com/mebjas/html5-qrcode/issues/332#issuecomment-1342831824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW6HBMN2Y7YBTFROAIPVHLWMHW5HANCNFSM5GYGNFUA . You are receiving this because you were assigned.Message ID: @.***>
Does someone has any updates on this matter on iOS? I'm experiencing the same issue
Does someone has any updates on this matter on iOS? I'm experiencing the same issue
waiting for the issue to be solved
your issue comes from Mac OS and its permissions. check how you set them trough MacOS settings
If you add "Html5Qrcode.getCameras()" it will ask for permissions every time it tries to scan
`
const html5QrCode = new Html5Qrcode("reader");
const qrCodeSuccessCallback = (decodedText, decodedResult) => {
/* handle success */
console.log(`Scan result: ${decodedText}`);
//STOP SCANNER
html5QrCode.stop();
}
//CONFING
const config = { fps: 10, qrbox: 220 };
//START SCAN
Html5Qrcode.getCameras().then(devices => {
html5QrCode.start({ facingMode: { exact: "user"} }, config, qrCodeSuccessCallback)
.then(res=>{
alert('init camera');
}).catch((err)=>{
alert('error permissions');
});
}).catch((err)=>{
alert('error permissions');
});
`
Does ios17 enable this to work on iOS devices yet?
If you add "Html5Qrcode.getCameras()" it will ask for permissions every time it tries to scan
does this mean I can do it as follows in order to avoid 2+ camera permission requests?
getCameras
-> this results in a camera permission request -> OK and save the camera ID of this device in my databasehtml5QrCode.start
@cyril23 Did you manage to get this working like this? I'm wondering if anyone has any time of workaround for now for iOS.
I am wondering if anyone is still having this issue? I still am.
still experiencing this issue
it's a IOS limitation, you have to allow your cam everytime when you close and start a browser, unless if you do what it said above like
@mebjas if users experience problems with some devices maybe the best would be to ask a contribution to buy this device and work on it. what do you think?
The camera permission is saved on all devices, even iOS. Safari does not ask for it again when granted, however, the webview in my app still ask for permission although the camera access is granted in the app settings in the system. Any solutions?
rememberLastUsedCamera
permission doesnt seem to work on Safari.Desktop (please complete the following information):