uni-app开启微信小程序后台定位报错?
wx.startLocationUpdateBackground({
success(res) {
console.log('开启后台定位', res)
wx.onLocationChange(function(res) {
console.log('location change', res)
})
},
fail(res) {
console.log('开启后台定位失败', res)
}
})
报:{errMsg: “startLocationUpdateBackground:fail scope unauthorized”}错误!
编译后的app.json文件中有相关配置:
,
"permission": {
"scope.userLocation": {
"desc": "上报信息需要获取您的位置"
}
},
"requiredBackgroundModes": [
"location"
],
同样代码和配置,原生小程序在真机上调试没有问题!
uni-app论坛无人回答,有解决方案吗?
3 回复