vue-qrcode-reader icon indicating copy to clipboard operation
vue-qrcode-reader copied to clipboard

[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.

Open Arobase-fr opened this issue 2 years ago • 2 comments

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):

  • OS: [macOS Big Sur v11.4 (Apple M1)]
  • Browser [Safari]
  • Version [14.1.1]

Smartphone (please complete the following information):

  • Device: [iPhone XR]
  • OS: [iOS 14.3]
  • Browser [Safari]

Arobase-fr avatar Jul 29 '21 08:07 Arobase-fr

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.

Arobase-fr avatar Jul 29 '21 08:07 Arobase-fr

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" />

samydoesit avatar Nov 22 '21 16:11 samydoesit

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

github-actions[bot] avatar Jul 23 '23 00:07 github-actions[bot]