PWA mobile camera access

jinu S picture jinu S · Jul 6, 2017 · Viewed 23.9k times · Source

My requirement is to access the mobile camera in iOS and android using the mobile browser.

Using Ionic PWA app can I access mobile camera in iOS and android device browsers? Looking for PWA solution using Cordova (not native solution).

Answer

Gokul picture Gokul · May 19, 2018

While working on a PWA. I came across the need to access a mobile device's camera/images.(a native app was out of the question). After doing some research I came across this little nugget.

<input type="file" accept="image/*" capture="camera" />

By adding the accept and capture attributes I was able to access my phone's camera and images. I should also point out that you don't need to do anything special with your Server side (Node or PHP). It acts just like a standard file upload input in a browser.