Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can PWA access contacts, gps or use the phone camera?

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 ?

like image 496
KrissJedi Avatar asked Apr 15 '19 16:04

KrissJedi


People also ask

Can a PWA access phone contacts?

Can PWA access contacts? No there is no way to access contacts in PWA, it is mainly restricted for security purposes.

Can you access camera with PWA?

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.

Can Progressive Web Apps access the device hardware features?

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.

Will PWA work properly on any mobile device?

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.


2 Answers

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.

enter image description here

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.

like image 145
Francesco Avatar answered Sep 21 '22 17:09

Francesco


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.

like image 31
charliefortune Avatar answered Sep 21 '22 17:09

charliefortune