gruhn / vue-qrcode-reader

A set of Vue.js components for detecting and decoding QR codes.
https://gruhn.github.io/vue-qrcode-reader
MIT License
2.03k stars 330 forks source link

[iOS / Cordova / VueJS] NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. #254

Closed Arobase-fr closed 11 months ago

Arobase-fr commented 2 years ago

Describe the bug Plugin is not working in iOS in Cordova / VueJS Project I have a prompt asking me the permission for the camera but when i accept it it shows me the NotAllowedError. Going to the params of the app in iOS shows me that camera permission is granted.

'NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.'

To Reproduce Clone this repository https://github.com/c4software/vuejs-cordova-sample Install vue-qrcode-reader Import QrcodeStream Run the app on an iPhone and see

Screenshots Error returned in the console : https://prnt.sc/1hith0r Permissions granted : https://prnt.sc/1hitum7

Desktop (please complete the following information):

Smartphone (please complete the following information):

Arobase-fr commented 2 years ago

I'd add that the Demo Page works on the iPhone for "decode continuously" but not for the "upload" one, after uploading the picture it only shows me the picture i uploaded and nothing get pasted as a result.

samydoesit commented 2 years ago

I got this working using capacitorJS and decode continuously on iOS.

Maybe you need to add a hostname to your cordova config.xml.

Try to add this to your config.xml - Cordova iOS 6.0.0 Released! - WKURLSchemeHandler introduction fixes CORS issues

<preference name="scheme" value="app" />
<preference name="hostname" value="localhost" />
github-actions[bot] commented 11 months ago

This issue has been marked as stale. If there is no further activity it will be closed.