I posted this in the react-native-webview
discussion thread in GitHub in case this is something they need to add support for, but wanted to see if anyone had any thoughts here:
Disclaimer: I'm a web developer, not an android developer so my knowledge of all things android is shallow at best.
My team has noticed that our PWA application with a react native webview layer seems to only experience issues with an <input type='file' capture>
element based camera for pixel users (at least 6 and 8) running android 14. It appears to work fine to bring up the camera for other Pixel users running 13 and below.
Is anyone aware of any reason why this method would fail on the Pixel / android 14 combination in particular? I've seen some threads that 14's SAF cracked down on access to the phone's files, which the camera would be considered with the html input type="file"
element, but even if that's the case, I'm not sure what can be done on our end. Any insight would be greatly appreciated!
As a note, we're using capture('') to force open the camera and deny the photo file picker.
<input id="camera" type="file" name="picture" accept="image/*" capture={'' as any} ref={inputFileRef} onChange={(e) => handlePhotoChanges(e)} />
In handlePhotoChanges
is a line inputFileRef.current.click()
that fires but fails to open the camera.
HTML input file element docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
We have narrowed the issue down to Pixel users running android 14, but are still researching what might be particular about pixel and android 14 to cause this issue.