微信低版本的用户无法调用新的getUserProfile接口如何处理?

小程序 文章 2021-04-06 09:42 791 0 全屏看文

AI助手支持GPT4.0

微信低版本的用户无法调用新的getUserProfile接口如何处理?What should I do if users with lower versions of WeChat cannot call the new getUserProfile interface?

微信低版本的用户无法调用新的getUserProfile接口如何处理?

线上的小程序版本已经做了判断

使用了 wx.canIUse 来判断用户环境是否支持getUserProfile接口.

但是还是存在大量用户微信版本过低. 不支持getUserProfile接口. (年龄比较大的用户..占比很大)

此时只能继续走 wx.getUserInfo 来确保用户可以顺利登录...但是此时 用户登录后 都无法获取到昵称 / 头像 / 性别 / 地区等基本用户信息了..

请问各位大大们. 有什么好的处理方式吗.?

The online app version has been used wx.canIUse To determine whether the user environment supports the getuserprofile interface. However, there are still a large number of users whose wechat version is too low. They do not support the getuserprofile interface wx.getUserInfo To ensure that the user can log in smoothly... But after the user logs in Can't get the basic user information, such as nickname / avatar / gender / region. What's a good way to deal with it?

回答:

拾忆:

登陆只要判断openid就行了,为啥要根据用户昵称来判断?

如果之前已经存过那个用户的信息,新获取的如果为“微信用户”就不要覆盖旧的信息,这样能避免掉一部分低版本的问题。

Rice _拓维互动:对于商城来说.. 获得用户昵称 性别等信息还是有一定的重要性的
Brother斌🎈:

别用wx.canIUse来判断,按官方示例文档的if(wx.getUserProfile)判断

跨商通:

1、提示用户升级微信;

2、这批用户的个人资料等信息,不要了;反正不影响你的正常业务。

3、没有办法。

-EOF-

AI助手支持GPT4.0