Is there a way for PWAs to access the phone number of the host device?

徘徊边缘 提交于 2020-08-24 06:53:27

问题


I plan on developing a Progressive Web App for Android devices - one major concern is if the PWA can access the host phone number. Our business is providing cheap mobile phones to our business partners and if our PWA can access the phone numbers of the devices, we can do easier 2-factor authentication.

I figure the way a PWA can access the host phone number - is when the user launches the app from their mobile phone's Home Screen.

Is this possible somehow? This great answer from Dan doesn't cover this question unfortunately: What features do Progressive Web Apps have vs. native apps and vice-versa, on Android


回答1:


No. PWA can't access the host's phone number. I'm not sure if you are saying or asking if PWA can access phone number if its accessed from home screen. Either case, PWA cant access the phone number.. even after installing/adding to home screen, its still limited to web standards and it can only do what web can do.today

You can implement with native code and pass on such PWA unavailable capabilities using secure web sockets to PWA socket client (from localhost WSS server in native ). we have some solution like that and it works fine.



来源:https://stackoverflow.com/questions/51164662/is-there-a-way-for-pwas-to-access-the-phone-number-of-the-host-device

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