HarmonyOS webview浏览器获取定位异常

HarmonyOS
2024-12-19 16:23:40
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zxjiu

获取设备位置信息需要先在module.json5文件配置ohos.permission.LOCATION,ohos.permission.APPROXIMATELY_LOCATION权限,如:

{
  "name":
  "ohos.permission.LOCATION",
  "reason":
  "$string:module_desc",
  "usedScene":
  {
    "when":
    "inuse"
  }
}
,
{
  "name":
  "ohos.permission.APPROXIMATELY_LOCATION",
  "reason":
  "$string:module_desc",
  "usedScene":
  {
    "when":
    "inuse"
  }
}
,
{
  "name":
  "ohos.permission.LOCATION_IN_BACKGROUND",
  "reason":
  "$string:module_desc",
  "usedScene":
  {
    "when":
    "inuse"
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.

onGeolocationShow中需要设置允许站点地理位置权限请求具体使用,可以参考管理位置权限文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/web-geolocation-permission-V5

分享
微博
QQ
微信
回复
2024-12-19 18:11:55
相关问题
服务卡片webview如何跳转系统浏览器
8883浏览 • 2回复 待解决
HarmonyOS 启动默认浏览器
1589浏览 • 1回复 待解决
浏览器应用应该怎样拉起?
1239浏览 • 2回复 待解决
HarmonyOS 如何在浏览器唤起app
1763浏览 • 1回复 待解决
HarmonyOS 浏览器内无法下载charles证书
1121浏览 • 1回复 待解决
HarmonyOS浏览器scheme链接唤起APP问题
2169浏览 • 1回复 待解决
HarmonyOS applink从浏览器跳转到应用
1301浏览 • 1回复 待解决
HarmonyOS 浏览器真机调试问题
835浏览 • 1回复 待解决
Web组件是否支持浏览器的localstorage?
1656浏览 • 1回复 待解决
浏览器下载的文件如何导入鸿蒙
8605浏览 • 1回复 待解决
HarmonyOS 跳转到外部浏览器固定链接
980浏览 • 1回复 待解决
HarmonyOS 浏览器不能通过scheme拉起app
1666浏览 • 1回复 待解决