iOS Standalone PWA input capture
Asked Answered
E

3

12

I think we found a regression in iOS 13.2/13.3 in regard to PWAs running in standalone mode.

Since on iOS PWA cannot access getUserMedia() we rely on the capture attribute on the HTML5 input tag to let the user take a picture and send it to a server.

Our code looks like this:

<div class="camera-upload">
     <input type="file" class="hidden" name="uploadPhotoInput" accept="image/*" capture="environment" (change)="onTakePhoto($event)">
     <button type="button" class="btn btn-primary">Take photo</button>
</div>

When we run the PWA in standalone mode on devices with iOS 13.1 or lower everything works as expected. If we run the PWA in browser mode on Safari everything works regardless of the iOS version.

When we run the PWA on devices with iOS 13.2 or 13.3 the feature works until we put the PWA in background and then in foreground again. After the PWA is sent to the background the capture launch the camera, but the preview is jut black. All the camera controls (flash, etc) works, but no picture is taken.

We run a test with the XCode console logger attached and it looks AVCaptureSession cannot be started after the app has been put in background once.

Here is a trace of the device logs:

https://pastebin.com/qGZpN6dM

We are building our PWA with Angular 8.

Has anyone seen something like this or can give us an hint?

Ettaettari answered 9/12, 2019 at 18:53 Comment(3)
Same problem here, we tried many things like removing and creating file input dynamically on visibility change, or reloading page on visiblity change... so far no solution... we need a solution for this anyone found a solution ?Acrophobia
Same question here : #59423338Acrophobia
Has anyone reported that bug to apple ? feedbackassistant.apple.com/welcomeAcrophobia
C
3

@elbuild

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

Bug was posted here. Feel free to contribute to posting as well to gain traction, I'll be doing the same

Coralline answered 14/1, 2020 at 10:43 Comment(1)
Thank you for adding the bug report. I had this issue in 13.3. Updating to 13.5.1 did the trick for me.Paranymph
A
0

Errr... no. 13.4 still does it, sorry.

I just tell users that if they get this, they should flick the app away to close it (rather than just going to home). A poor workaround, but hopefully a real fix will arrive someday.

Anomalous answered 4/4, 2020 at 14:45 Comment(0)
B
-2

Finally, this has been resolved in iOS13.4

Badger answered 2/4, 2020 at 3:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.