Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张 SIM 卡,其中 android 本身显示为未知的电话号码。
因此也getLine1Number()返回一个空的string。但是,WhatsApp能够完美地读取我的电话号码。
getLine1Number()
string
我想知道它是如何工作的(技术上)。
有人有想法吗?
它没有。应用程序无法获取电话号码。Whatsapp 手动询问号码,并通过短信向您发送验证码。
检索电话号码并非总是可行和允许的。大多数移动运营商将此功能锁定在他们的手机中。
WhatsApp询问电话号码并保存
如果用户允许,您可以将 SMS 发送到服务器并保存。
一种解决方案是在收到的 SMS 中查找最常见的电话号码。
WhatsApp 有权这样做。