- 隐私授权同意后为何还获取不到用户真实的昵称和头像?
<view wx:if="{{showPrivacy}}"> <view>隐私弹窗内容....</view> <button bindtap="handleOpenPrivacyContract">查看隐私协议</button> <button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button> </view> handleAgreePrivacyAuthorization() { wx.getUserProfile({ desc: '用于完善信息', success: (res) => { app.globalData.userInfo = res.userInfo; // 此处获取到的还是匿名信息 wx.setStorage({ key: 'userinfo', data: res.userInfo }); }, fail: (e)=>{ console.log(e) } }) },
2023-09-01 - 同一个小程序,getUserProfile发布小程序的能拉起授权,本地代码在手机预览时拉不起来?
[图片] 使用getUserProfile获取头像昵称。 真机调试查看到基础库版本是3.0.1,报错{errMsg: "getUserProfile:fail privacy permission is not authorized", errno: 104},未拉起上述弹窗。 但是同一台安卓手机,基础库应该也是一样的啊,为什么发布过的小程序能正常使用呢(上图为线上小程序)?
2023-09-01