问题
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