小程序又偷偷改接口申请了。
7月14审核机制后
新的涉及位置这种隐私的权限要求,必须在package.json中申明。以uni为例。
https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01?blockType=1

"requiredPrivateInfos":[
"getLocation",
"onLocationChange",
"startLocationUpdate",
"startLocationUpdateBackground"
]
mainifest.json中也改下:
参考permission
中对应申请
"mp-weixin" : {
"appid" : "wx0868ad03b79b1465",
"setting" : {
"urlCheck" : false,
"es6" : true,
"postcss" : true,
"minified" : true
},
"usingComponents" : true,
// 这里加云函数路径
"cloudfunctionRoot" : "cloudfunctions/",
"permission" : {
"scope.userLocation" : {
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
}
},
"requiredBackgroundModes" : [ "location" ],
"optimization" : {
"subPackages" : true
}
},
打包后如果page.json中不存在,则复制上面申请。
网友评论