9

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

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
  • 1
    I am not sure but may be this answer will give you some idea. Get device info i.e. phone number in android native code and then access from PWA using deep linking: https://stackoverflow.com/a/49618934/631803 – Vikasdeep Singh Jul 04 '18 at 01:41

1 Answers1

11

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.

Anand
  • 9,672
  • 4
  • 55
  • 75
  • 2
    @Anand - could you please give some example code snippet on how to use native code to get device contacts and use it in PWA. As I'm new to PWA it would be greatly helpful for me. – Sankar Aug 10 '19 at 05:02