getLocation 需要在 app.json 中声明 Permission 字段

小程序开发中,清除授权状态后,重新编译,提示:getLocation 需要在 app.json 中声明 Permission 字段

需要在 app.json 里面增加 permission 属性配置(小游戏需在game.json中配置):

  "permission": {
    "scope.userLocation": {
      "desc": "你的位置信息将用于小程序位置接口的效果展示"
    }
  },

效果:

 

确定之后即可授权。

 

posted @ 2019-05-31 01:39  雪山上的蒲公英  阅读(3295)  评论(0编辑  收藏  举报
/* 返回顶部代码 */