uniapp获取位置时显示getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json
解决方式:1.manifest.json文件 "mp-weixin" 中添加
"permission" : {
"scope.userLocation" : {
"desc" : "小程序将使用定位功能"
}
},
"requiredPrivateInfos": [
"chooseAddress",
"chooseLocation",
"choosePoi",
"getLocation",
"onLocationChange",
"startLocationUpdateBackground",
"startLocationUpdate"
]
标签:uniapp,getLocation,declared,app,ext,json,fail,requiredPrivateInfos From: https://www.cnblogs.com/shuhan-hou/p/17611980.html