Bug 185448 - getUserMedia not working in apps added to home screen that run in standalone mode
Summary: getUserMedia not working in apps added to home screen that run in standalone ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-08 14:50 PDT by Thomas Steiner
Modified: 2019-08-15 23:44 PDT (History)
35 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Steiner 2018-05-08 14:50:01 PDT
Steps to reproduce:

1) Go to https://qrsnapper.appspot.com in Safari. 
2) Grant camera access and see a live picture.
3) Add https://qrsnapper.appspot.com to the home screen.
4) Launch the app from the home screen and notice how getUserMedia is not supported. 

This also affects more prominent apps like https://ofo.ride.com/, a ride sharing app featured at Google i/o.
Comment 1 Thomas Steiner 2018-05-08 14:54:38 PDT
Sorry, wrong URL, try https://ride.ofo.com/#/scancode instead.
Comment 2 Radar WebKit Bug Importer 2018-05-10 21:02:36 PDT
<rdar://problem/40152738>
Comment 3 Thomas Steiner 2018-10-31 04:50:07 PDT
Also reported in https://bugs.webkit.org/show_bug.cgi?id=185448.
Comment 4 Rick Lania 2019-01-28 09:36:40 PST
This also was an issue with Stance's self checkout PWA: https://go.stance.com/

Consumer's could not scan product bar codes once the app was added to the home screen.
Comment 5 Nick 2019-01-28 19:47:26 PST
This is also causing problems for https://vision.bloomberg.com. WebApp is un-usable as a full screen PWA.
Comment 6 dirkk0 2019-02-09 03:39:25 PST
I can confirm this.

Q1: Is there any information why the PWA WebKit was crippled to not support getUserMedia (which the standard WebKit supports), and if this behaviour is intended and going to stay?
Q2: Also, could somebody provide a link to the official documentation (I didn't find any) that documents this behaviour, so that PWA developers don't fall into that trap?

Thanks, Dirk
Comment 7 Jamal 2019-02-28 02:52:12 PST
I also had problems with https://qrsnapper.com/
Comment 8 Stéphane Magnenat 2019-03-04 08:25:34 PST
This is likely similar to:
- this bug on chromium tracker: https://bugs.chromium.org/p/chromium/issues/detail?id=752458 
- this bug tracking an issue submitted to Apple: http://www.openradar.me/33571214
- this discussion on Apple developer forum: https://forums.developer.apple.com/thread/88052
Comment 9 dom 2019-04-08 10:03:09 PDT
+1 -- highly desirable to improve the quality of homescreen PWAs.

Access to phone camera in particular is very high priority: works in Safari, works on Android, why doesn't it work on an iOS homescreen PWA?

Please prioritize!
Comment 10 Philipp 2019-04-09 14:01:59 PDT
+1 Would be great to have this
Comment 11 Ernst 2019-04-15 01:42:35 PDT
+1 It will be fantastic to have this.
Comment 12 Mike Benna 2019-05-13 10:24:49 PDT
+1 I have an Angular SPA that needs the microphone for transcription services. It's a shame it works fine in Safari as a web page but won't work from the home screen as a PWA. That seems totally backwards to me.
Comment 13 youenn fablet 2019-05-21 14:05:00 PDT
(In reply to dirkk0 from comment #6)
> I can confirm this.
> 
> Q1: Is there any information why the PWA WebKit was crippled to not support
> getUserMedia (which the standard WebKit supports), and if this behaviour is
> intended and going to stay?

This is a known limitation of WKWebView that we want to fix.
Comment 14 gabrielstuff 2019-06-03 13:37:02 PDT
hello !
I could not believe it when I read it! Are you planing support for getUserMedia in WKWebView ? If so, do you have a schedule to share ?

Can we help ?

Thanks a lot,

Gabriel
Comment 15 gabrielstuff 2019-06-03 13:46:05 PDT
Please not that this has been there since 2 years :

https://bugs.webkit.org/show_bug.cgi?id=180551

Thanks for any infos.

G
Comment 16 Dmitriy 2019-06-04 00:43:38 PDT
We need it for our app. We need this feature for scanning barcodes, but it is not available in Safari on iOS.
Comment 17 Nick 2019-06-05 18:08:19 PDT
I can confirm this is now working on iOS 13 beta 1!

Woohoo!!
Comment 18 Thomas Steiner 2019-06-06 00:55:36 PDT
Thanks, team WebKit from team Chromium: https://twitter.com/ChromiumDev/status/1136541745158791168. 🎉
Comment 19 Thomas Steiner 2019-06-19 06:20:45 PDT
FYI, this seems to have regressed on iOS and iPadOS 13 beta 2, while it was still working on beta 1.

I just verified this to no longer work on my iOS device, and @garygarside on their iPadOS device (https://twitter.com/garygarside/status/1141319378920726531).
Comment 20 Eric Carlson 2019-06-19 08:58:44 PDT
(In reply to Thomas Steiner from comment #19)
> FYI, this seems to have regressed on iOS and iPadOS 13 beta 2, while it was
> still working on beta 1.
> 
> I just verified this to no longer work on my iOS device, and @garygarside on
> their iPadOS device
> (https://twitter.com/garygarside/status/1141319378920726531).

@tomac we had to disable the feature because we found a serious bug. We're working hard to fix it and hope to be able to re-enable it soon.
Comment 21 Gaël FOULON 2019-07-03 09:31:53 PDT
I'm wrong or in iOS 13 beta 3: even in Safari the getUserMedia is no more working (even not asking to grant access to camera).
Please confim that iOS 13 will include getUserMedia for both Safari and PWA from Home Screen.
It was a fantastic news on Beta1, so sad on Beta2 and even more confusing in Beta3.
Thank you for your feedback.
Comment 22 Ezequiel Actis Grosso 2019-07-18 14:44:15 PDT
Still not working in beta 4. Not even in Safari.
Comment 23 Nick 2019-07-18 15:22:28 PDT
Oddly enough, it only works in landscape for me on iOS 13 beta 4. I hope this isn’t a situation like image/webp where an exciting feature gets teased in a beta only to be removed before the final release. However, I understand that sometimes it has to be this way.
Comment 24 youenn fablet 2019-07-18 15:28:40 PDT
(In reply to Nick from comment #23)
> Oddly enough, it only works in landscape for me on iOS 13 beta 4.

This is probably bug 199519 which is fixed in ToT.
Comment 25 rud erm 2019-07-24 06:47:15 PDT
can you confirm getUserMeida for PWA on ios 13?
Comment 26 Bryant P 2019-07-30 11:19:43 PDT
Just tested with iOS 13 Beta 5, no luck.
Comment 27 Thomas Steiner 2019-07-31 01:57:58 PDT
(In reply to Eric Carlson from comment #20)
> @tomac we had to disable the feature because we found a serious bug. We're
> working hard to fix it and hope to be able to re-enable it soon.

Meanwhile just to highlight the hoops people go through to make this happen: "We have invented our own workaround in Cordova since iOS 11 by using a native plugin for capturing the camera, then sending it with WebRTC to the WKWebView (which joins as a peer on local phone WITHOUT signaling server) and receives a usable VideoStream, with 1ms delay."—https://twitter.com/QbixApps/status/1156484156425039872
Comment 28 Tin 2019-08-08 23:59:28 PDT
It still doesn't work in iOS 13 Beta Build 6....
Comment 29 jamauro 2019-08-11 15:27:53 PDT
+1 please add getUserMedia support for PWAs
Comment 30 Conrad C 2019-08-12 20:30:49 PDT
(In reply to Tin from comment #28)
> It still doesn't work in iOS 13 Beta Build 6....

I just tested with iOS 13 beta seed 6 and it worked.  Device I used was an old iPhone 6S.
Comment 31 Thomas Steiner 2019-08-13 00:14:10 PDT
> I just tested with iOS 13 beta seed 6 and it worked.  Device I used was an
> old iPhone 6S.

Please note that this bug is exclusively for web apps that are added to the home screen. Could you confirm that it works when you add https://qrsnapper.com to the home screen and launch it from there? For what it's worth, I just tried it (again), and it failed (on an iPhone X, iOS 13 beta 6).
Comment 32 Tin 2019-08-13 02:04:02 PDT
(In reply to Thomas Steiner from comment #31)
> > I just tested with iOS 13 beta seed 6 and it worked.  Device I used was an
> > old iPhone 6S.
> 
> Please note that this bug is exclusively for web apps that are added to the
> home screen. Could you confirm that it works when you add
> https://qrsnapper.com to the home screen and launch it from there? For what
> it's worth, I just tried it (again), and it failed (on an iPhone X, iOS 13
> beta 6).

I tried my own application in standalone mode and the qrsnapper you provided. I've added them both to my homescreen as a PWA. When trying to acces my camera, it doesn't show any permissions at al.
Comment 33 Thomas Steiner 2019-08-13 02:05:54 PDT
> I tried my own application in standalone mode and the qrsnapper you
> provided. I've added them both to my homescreen as a PWA. When trying to
> acces my camera, it doesn't show any permissions at al.

Right, so it fails, which is inline with what everyone else has experienced so far. Thanks for confirming.
Comment 34 Conrad C 2019-08-13 18:43:19 PDT
(In reply to Thomas Steiner from comment #33)
> > I tried my own application in standalone mode and the qrsnapper you
> > provided. I've added them both to my homescreen as a PWA. When trying to
> > acces my camera, it doesn't show any permissions at al.
> 
> Right, so it fails, which is inline with what everyone else has experienced
> so far. Thanks for confirming.

I can replicate the issue you are having with qrsnapper.com, but our web app which did not work prior to beta seed 6 now works.  

I also noticed that go.stance.com, which was previously reported as not working in comment 4, now works.

Here is a video capture when of each of the 3 web apps: https://www.dropbox.com/s/t731imv9gli5bur/qrscanner_RPReplay_Final1565746618.MP4?dl=0
Comment 35 Conrad C 2019-08-13 20:34:27 PDT
And screen capture showing it working as home screen shortcut, not just a favorite: 

https://www.dropbox.com/s/mt9lfumdielsejr/qrscanner_home_screen_shortcut_RPReplay_Final1565753566.MP4?dl=0
Comment 36 Tin 2019-08-13 23:43:06 PDT
(In reply to Conrad C from comment #35)
> And screen capture showing it working as home screen shortcut, not just a
> favorite: 
> 
> https://www.dropbox.com/s/mt9lfumdielsejr/
> qrscanner_home_screen_shortcut_RPReplay_Final1565753566.MP4?dl=0

Hey, thanks for the update.
Have you tried to convert it to a Progressive Web App yet in standalone mode?
If you could do that and confirm that would be great.

I've tried your method already by setting it to browser display mode and it works yes.
Comment 37 Stéphane Magnenat 2019-08-13 23:59:20 PDT
does anyone knows if getUserMedia also works in WkWebView? I expect PWA to be built on WkWebView but it is unclear to me whether the security rules will be the same. WkWebView support is important for web-based apps such as ones built on Cordova.
Comment 38 Thomas Steiner 2019-08-15 23:44:42 PDT
Just tested https://qrsnapper.com/ added to home screen in beta 7 (build 17A5565b). Doesn't work :-(