需要将 button 组件 open-type 的值设置为 getPhoneNumber,当用户点击并同意之后,可以通过 bindgetphonenumber 事件回调获取到微信服务器返回的加密数据, 然后在第三方服务端结合 session_key 以及 app_id 进行解密获取手机号。
我这解密出来的数据没有手机号信息啊,还是只有用户头像的基础信息,请问是基础库的版本问题吗?The data I decrypted has no mobile phone number information, or only the basic information of the user's avatar. Is it a problem with the version of the basic library?
我这解密出来的数据没有手机号信息啊,还是只有用户头像的基础信息,请问是基础库的版本问题吗?框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|
小程序 | Bug | 获取手机号的api | 微信安卓客户端 | 8.0.16 | 2.19.6 |
需要将 button 组件 open-type 的值设置为 getPhoneNumber,当用户点击并同意之后,可以通过 bindgetphonenumber 事件回调获取到微信服务器返回的加密数据, 然后在第三方服务端结合 session_key 以及 app_id 进行解密获取手机号。
Framework type problem type API / component name terminal type wechat version basic library version applet bug API wechat Android client 8.0.16 2.19.6 needs to set the value of button component open type to getphonenumber. After the user clicks and agrees, the encrypted data returned by wechat server can be obtained through bindetphonenumber event callback, Then combine session with the third-party server_ Key and app_ Decrypt the ID to obtain the mobile phone number.
回答:
换一下基础库,或者看下最新获取手机号的方法https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
请问,有人知道为啥嘛
encryptedData 传错了
代码怎么写的贴一下