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

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

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

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

效果:

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

确定之后即可授权。

 

相关文章:

  • 2022-12-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-10-01
  • 2021-06-17
  • 2022-12-23
  • 2021-07-10
猜你喜欢
  • 2021-06-15
  • 2021-07-12
  • 2021-11-26
  • 2021-06-02
  • 2021-12-25
  • 2021-08-14
相关资源
相似解决方案