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

我的梦境 提交于 2020-03-20 01:58:42

问题


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 ?


回答1:


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.




回答2:


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.




回答3:


Take a look at: https://caniuse.com/

Body must be at least 30 characters; you entered 16.



来源:https://stackoverflow.com/questions/55693406/can-pwa-access-contacts-gps-or-use-the-phone-camera

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!