ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

No Cameras found in iOS when launching from the home screen.

Open JKing-B16 opened this issue 6 years ago • 6 comments

If you use the Angular PWA and add the application to the home screen, then when you launch the App via Home screen it will fail to find the camera, but go to the program in Safari and you have camera access. It may have something to do with PWA requirements of iOS:

https://forum.ionicframework.com/t/ios-11-its-not-me-its-you-tags-ios11-pwa-camera/126556

Build an App with PWA Navigate to URL in Safari in iOS 11/12 Use sharing to "Add to Homescreen" open App from Homescreen => No cameras found

Expected behavior Cameras Found

Smartphone (please complete the following information): Tested on: iPad3 iOS 12 => fails from PWA iPhone 6s iOS 11.4 => fails from PWA OnePlus 5 Android 8.1 => works

JKing-B16 avatar Nov 01 '18 14:11 JKing-B16

Same thing here.

Tested on iPhone 5s w/ iOS 12. App in Safari is working, but when added to home screen is not.

acarbonellb avatar Nov 01 '18 15:11 acarbonellb

I hope you understand that this is a limitation Apple imposes over us. The WKWebView doesn't have implementations for the navigator.getMediaDevices which we use to get the camera stream. I already filed lots of issues around GitHub due to that, but I really can't do nothing for that, I just ask my users to open the browser if they want to use the camera ~and thats a terrible thing~.

I'm still wating for Apple to update this ~shit~ behavior.

Also I added some notes in https://caniuse.com/#feat=stream about that.

I you have any update about this issue, feel free to share here, thanks.

odahcam avatar Nov 01 '18 15:11 odahcam

Apparantly they enabled it for iOS 13 beta, but then for some reason disabled it again: https://twitter.com/kkogovsek/status/1143826175543914497

10eputzen avatar Aug 27 '19 20:08 10eputzen

Apple update on it: https://bugs.webkit.org/show_bug.cgi?id=185448#c20

odahcam avatar Aug 28 '19 01:08 odahcam

Yet another update: https://bugs.webkit.org/show_bug.cgi?id=185448#c88 May work on iOS 13.4

j0kan avatar Apr 16 '20 16:04 j0kan

Thanks @j0kan !

As comment 96 says:

I can confirm that 13.4 on iPhone 11 pro after removing am able to access the camera (using webrtc) from a shortcut added to the home screen.

For those looking for putting pressure in Apple, head to Bug 208667 as pointed here.

I'm very against spam, but Apple deserves a little since we're waiting 2 years for a fix that so many developers ask for and so many users are impacted because of it.

odahcam avatar Apr 16 '20 17:04 odahcam