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).
I went through many blogs and tutorials for this and I found few things are not working with IOS while Android has good support for PWA. Let's see them one by one. Can PWA access camera? Yes, both the OS gives access to the camera, which allows image and video capturing in PWA.
Progressive web apps can also access device features, like the camera, GPS, contact book, and calendar. When a user launches a PWA, it doesn't launch the web browser. Instead, the app takes up the user's whole screen, which makes them look and feel like standalone apps.
There are some restrictions that cannot be overcome with a PWA: - you cannot access the contacts list on a phone. - On the other hand, you can take photos and use GPS location.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With