PWA是否可以访问主机设备的电话号码? [英] Is there a way for PWAs to access the phone number of the host device?

查看:80
本文介绍了PWA是否可以访问主机设备的电话号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划为Android设备开发渐进式Web应用程序-一个主要的问题是PWA是否可以访问主机电话号码.我们的业务是为我们的业务合作伙伴提供廉价的手机,如果我们的PWA可以访问设备的电话号码,那么我们可以更轻松地进行两步验证.

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.

我知道PWA可以访问主机电话号码的方式-是用户从手机的主屏幕启动应用程序的时间.

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.

这有可能吗?丹(Dan)给出的这个很好的答案不幸地没有涵盖这个问题:什么功能在Android上,渐进式Web应用程序具有与本机应用程序相比,反之亦然

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

推荐答案

否.PWA无法访问主机的电话号码.我不确定您是要说还是要询问PWA是否可以从主屏幕访问电话号码.无论哪种情况,PWA都无法访问电话号码.即使将其安装/添加到主屏幕后,它仍然仅限于网络标准,并且只能执行今天网络可以做什么

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

您可以使用本机代码实现,并使用安全的Web套接字将这些PWA不可用的功能传递给PWA套接字客户端(来自native中的localhost WSS服务器).我们有一些类似的解决方案,并且效果很好.

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.

这篇关于PWA是否可以访问主机设备的电话号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆