Can PWA access contacts, gps or use the phone camera?
Is this possible in any system (ios, android) ?
Is there any plan in development to implement any of these features ?
Can PWA access contacts? No there is no way to access contacts in PWA, it is mainly restricted for security purposes.
It's possible to access some, but not all, of the native device features from a PWA. One that we can access, is the camera and camera roll. We'll use two different methods to allow users to upload images to our application. First, we'll add a file input that accepts images.
With PWA, it can access the majority of the native device hardware, including push notification without relying on the browser or any other entity. Also, it's much faster than regular web applications and the cost of PWA development is also lesser than of developing a native mobile app.
Working on any platformPWA can work in any platform android, IOS or windows phone and you don't need to handle the app for every platform like the native 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.
On whatwebcando.today web site you can have a list of APIs available via browser compared to native apps. If you click on one feature, you can see a sample snippet showing how you can implement it and also details about the browsers support.
UPDATE 30.09.2019
From Chrome v77 there is a new experimental API available: Contact Picker
The Contact Picker API is an on-demand API that allows users to select entries from their contact list and share limited details of the selected entries with a website. It allows users to share only what they want, when they want.
For example, a web-based email client could use the Contact Picker API to select the recipient(s) of an email. A voice-over-IP app could look up which phone number to call.
Hence it might be that the the remaining PWA restrictions will be solved in a near future.
It depends on the device the PWA is running on.
Camera and audio seem to be universally supported. Contacts, on the other hand, seem to be inaccessible regardless of platform.
Other features, such as GPS and geolocation may vary from device to device.
A good way to find out what your browser is capable of (and thus your PWA - it runs in a web browser) is to go to https://whatwebcando.today with the browser you want to support. Try visiting it with an iPhone, Android or other device for a list of enabled features.
This list changes as browser and OS developers increase access to native features, so there's a good change that if it isn't available now, it will be in the future. However, it's important to be aware that some features such as access to the wider file system and hardware configuration are likely to remain sandboxed for security reasons.
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