ericblade / quagga2

An advanced barcode-scanner written in Javascript and TypeScript - Continuation from https://github.com/serratus/quaggajs
MIT License
766 stars 85 forks source link

Any idea what permissions I need to grant on a Cordova (phone gap) app for the Quagga JS to work on iOS? #498

Closed ghevge closed 1 year ago

ghevge commented 1 year ago

Hi, Any idea what permissions I need to grant on an Cordova (phone-gap) app for the Quagga JS to work on iOS?

I've provided these so far, but doesn't seem to be enough, as the app doesn't sees the camera(s).

<!-- Camera related stuff -->
        <edit-config target="NSCameraUsageDescription" file="*-Info.plist" mode="merge">
            <string>need camera access to take pictures</string>
        </edit-config>
        <edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
            <string>need photo library access to get pictures from there</string>
        </edit-config>
        <edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
            <string>need location access to find things nearby</string>
        </edit-config>
        <edit-config target="NSPhotoLibraryAddUsageDescription" file="*-Info.plist" mode="merge">
            <string>need photo library access to save pictures there</string>
        </edit-config>
ericblade commented 1 year ago

I unfortunately need to leave this for other people who have more recent experience with iOS.

It may possibly depend on your version of iOS, I think only the most recent one supports using the camera with a native webview, and i'm not positive that that even made it into the current release, or if it's still in beta.

We do use the browser facilities for camera, so that has to be available.

ericblade commented 1 year ago

It looks like this page describes the permissions necessary, as well as a workaround that might get it working on older iOS devices < 16 or whenever it was that getUserMedia was allowed for WebView applications.

https://developer.apple.com/forums/thread/134216

Without getUserMedia, it does not appear that there is any sort of Cordova plugin that allows one to get a camera source and feed it into a