quaggaJS icon indicating copy to clipboard operation
quaggaJS copied to clipboard

QuaggaJs Barcodescanner error in iOS safari WebApp

Open PrItHvI7 opened this issue 7 years ago • 13 comments
trafficstars

I am developing a webApp using Angular framework. I have used QuaggaJs barcode scanner for one of my module. Its works great on android chrome browser and it's webApp. And iOS safari browser. however while opening it through iOS Safari webApp, it crashes and gives the below error.

[Error] ERROR – Error: Uncaught (in promise): TypeError: undefined is not an object (evaluating 'k.inputStream.type')

i hope anyone has come through this or a fix here .

This is my config object { numOfWorkers: 4, locate: true, inputStream: { name: "Live", type: "LiveStream", target: this.barcode.nativeElement, constraints: { width: 640, height: 480, aspectRatio: { min: 1, max: 100 }, facingMode: "environment" }, area: { // defines rectangle of the detection/localization area top: "25%", // top offset right: "0%", // right offset left: "0%", // left offset bottom: "25%" // bottom offset }, singleChannel: false // true: only the red color-channel is read }, frequency: 10, decoder:{ readers: [ "code_128_reader", "ean_reader", "ean_8_reader", "code_39_reader", "code_39_vin_reader", "codabar_reader", "upc_reader", "upc_e_reader", "i2of5_reader" ], debug: { drawBoundingBox: false, showFrequency: false, drawScanline: false, showPattern: false }, multiple: false }, locator: { halfSample: true, patchSize: "medium", // x-small, small, medium, large, x-large debug: { showCanvas: false, showPatches: false, showFoundPatches: false, showSkeleton: false, showLabels: false, showPatchLabels: false, showRemainingPatchLabels: false, boxFromPatches: { showTransformed: false, showTransformedBox: false, showBB: false } } }, debug: false, }

PrItHvI7 avatar Aug 24 '18 12:08 PrItHvI7

Someone please correct me if I'm wrong, but I believe that iOS doesn't provide access to the camera from webview in applications.

ericblade avatar Aug 26 '18 08:08 ericblade

https://caniuse.com/#feat=webworkers,canvas,typedarrays,bloburls,blobbuilder,stream

As per the above link. getUserMedia/Stream API supports for iOS Safari 11.2, 11.4, 12, Which it gladly does. However there is no any specific information about support for iOS Safari Progressive Web Apps. And my application crashes with the above mentioned error while i try to go liveStream through Quagga barcode scanner, which needs access to camera indeed.

PrItHvI7 avatar Aug 27 '18 04:08 PrItHvI7

It does work in browser but not in webapp (standalone app). I presume it does not work in webview either. It is a ios thing.

nitinsbuzz avatar Sep 04 '18 19:09 nitinsbuzz

I have been having the same issue.

bchr02 avatar Sep 12 '18 03:09 bchr02

IOS works in webview from https

andreglegg avatar Sep 20 '18 10:09 andreglegg

I don't have an iOS device, so I'm no help in tracking that down. Thanks for confirming that it does work, though @andreglegg .

ericblade avatar Sep 20 '18 20:09 ericblade

@PrItHvI7 are you sure this isn't an error somewhere where you're handling the object? I'm not seeing anything in the source code, or build, "k.inputStream".

ericblade avatar Sep 20 '18 20:09 ericblade

So even I use https it won’t work with PWA in standalone mode only using safari as common browser? What about Android in stand-alone mode in PWA?

Lukasz-Chowaniec avatar Feb 23 '20 21:02 Lukasz-Chowaniec

Works pwa and standalone on android. But safari ios pwa is about to be fixed. Works for me in 13.4 beta . !!

Le dim. 23 févr. 2020 à 22:22, Lukasz-Chowaniec [email protected] a écrit :

So even I use https it won’t work with PWA in standalone mode only using safari as common browser? What about Android in stand-alone mode in PWA?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/serratus/quaggaJS/issues/324?email_source=notifications&email_token=AAY42EWTOP3PAMDIXO7U2JDRELSI7A5CNFSM4FRM5IS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWHXGA#issuecomment-590117784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAY42EURKHTE7LGEQLS66XDRELSI7ANCNFSM4FRM5ISQ .

mathiasmuller4sh avatar Feb 23 '20 21:02 mathiasmuller4sh

Great news! Is this beta release date known?

Lukasz-Chowaniec avatar Feb 23 '20 21:02 Lukasz-Chowaniec

seems like this tuesday!

daniellacosse avatar Mar 21 '20 22:03 daniellacosse

Did anyone made it work with type: liveStream in Safari? I can get a clear live view of the camera but the onDetected method doesn't recognise my barcode. Still works in Chrome.

jespergra avatar Apr 25 '21 18:04 jespergra

sure, it works fine in all modern safari versions. perhaps problem with configuration or camera selection?

ericblade avatar Apr 26 '21 06:04 ericblade