iOS Standalone PWA input capture

久未见 提交于 2019-12-22 07:09:00

问题


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?

来源:https://stackoverflow.com/questions/59254979/ios-standalone-pwa-input-capture

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!