getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json

微信开发工具报:getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json
手机上显示正常,能定位
经查 app.json 文件上需要添加 requiredPrivateInfos 。因为使用的是uniapp开发,在manifest.json上手动输入

"permission": {
    "scope.userLocation": {
      "desc": "为用户提供周边设施便捷查询"
    }
 },
// 需要添加这个
"requiredPrivateInfos": [
   "getLocation"
 ],
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容