Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 238
Alexander Mills Avatar asked Feb 04 '23 23:02

Alexander Mills


1 Answers

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.

like image 55
Anand Avatar answered Feb 06 '23 15:02

Anand