-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Use in Cordova App on iOS #271
Comments
Seems like camera permissions problem, have you tried using anything like this? |
Yes, I've installed that plugin also. So I installed and started the Barcodescanner plugin. Than it asks for the camera permission and the plugin works. After that I loaded the zxing library, but still the same error. Also when I run |
As this comment says, I think maybe cordova uses some web view implementation (obviously) and because of that the WebRTC API might not be available for Cordova on iOS. That seems like the same issue we have with PWAs at this moment. |
Hmm, thanks! |
Have you taken a look at React Native implementations? |
No. But I worked it out with the Cordova Barcodescanner plugin implemented in the hosted site. It only gets loaded when it's in the app. Otherswise it loads xzing. |
We're having the same problem. It's a known limitation because of missing WebRTC support in the WkWebView (hopefully this changes soon). Anyhow, there is cordova-plugin-iosrtc, which provides an implementation of WebRTC. We tried that out and only succeeded partially. The camera loads and is visible, but the scanSuccess (nor error) event aren't triggered. |
@wstrik can you elaborate how you worked around this limitation and scan barcodes on iOS cordova? |
@pj035 Did you work out how to use it together with the cordova-plugin-iosrtc to trigger the scanSuccess event? Or did you solve it in another way. Would be interested as I'm facing similar issues and haven't tried it yet |
@ninijay I was testing this for a customer app and due to time constraints I didn't follow it any further. We are now using one of the ionic plugins to scan QR codes. They are slower, but at least we can use them (no blame on ngx-scanner, but rather on Apple). Sorry! |
Just as an update, latest iOS version seem to support the WebRTC API needed for this component to work. I didn't test it yet, but it's good news already. |
In relation to #167 and #210 I'm trying to get the zxing-js library working with Cordova on iOS.
Thanks to the related issues, it is working on Android. I guess it's the same problem that was with Android. Which is it doesn't has permissions for the camera.
I have just a blank page with the plugin on it. I get the following error:
ERROR: {"line":2,"column":28352,"sourceURL":"..../zxing-umd.js"}
Which reads:
throw new Error("Can't enumerate devices, method not supported.");
As said, i think this is because of no camera permissions.
I tried installing the barcodescanner with no result.
The text was updated successfully, but these errors were encountered: