升级微信版本8.0.40 之后 小程序获取获地理位置失败 getLocation:fail privacy permission is not authorized
async function getLocation(parames = {}, isRefresh = false) {
let locationResult = await wx.getLocation(parames).catch((err) => ({ err: 'err', ...err }))
if (locationResult.err === 'err') {
if (locationResult.errMsg == 'getLocation:fail:auth denied' ||
locationResult.errMsg == 'getLocation:fail auth deny' ||
locationResult.errMsg == 'getLocation:fail authorize no response') {
openSettingForLocation(parames).then(()=>{
return Promise.resolve(locationResult)
}).catch(()=>{
return Promise.reject(locationResult)
})
} else {
wx.showModal({
title: '提示',
content: '获取地理位置失败',
icon: 'error',
showCancel: false,
})
return Promise.reject(locationResult)
}
}
}
{"err":"err","errMsg":"getLocation:fail privacy permission is not authorized","errno":104}
2023年9月15日之前,此功能逻辑只对开发版/体验版生效,开发者请尽快进行隐私弹窗适配、发版。2023年9月15日之后,将对正式版生效,详情可见《关于小程序隐私保护指引设置的公告》。
我**************************
看到大家都有问题,我就放心了
我用的基础库是2.23的,请求都正常,不使用3.0以上的版本,发布线上,后期会有什么问题吗
在小程序管理后台,完善一下相对应的用户隐私保护协议
看一下这个适配一下,基础库如果是2.33.0以上就得适配了
https://developers.weixin.qq.com/community/develop/doc/00042e3ef54940ce8520e38db61801
开发包 、体验包 都有问题 线上包ok 不知道 发布后线上会不会也挂
开发工具没问题,手机就fail privacy permission is not authorized
我是授权登录有这个问题