HarmonyOS 通过h5定位getCurrentPosition获取到的定位数据为空对象

HarmonyOS
2024-12-17 13:55:24
1.2w浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
fox280

需要在module.json5文件中配置ohos.permission.LOCATION,ohos.permission.APPROXIMATELY_LOCATION权限。

{
  "name":
  "ohos.permission.LOCATION",
  "reason":
  "$string:reason",
  "usedScene":
  {
    "abilities": [
    "FormAbility"
    ]
    ,
    "when":
    "inuse"
  }
}
,
{
  "name":
  "ohos.permission.APPROXIMATELY_LOCATION",
  "reason":
  "$string:reason",
  "usedScene":
  {
    "abilities": [
    "FormAbility"
    ]
    ,
    "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.
分享
微博
QQ
微信
回复
2024-12-17 16:05:20


相关问题
sim.getOpNameSync获取到
628浏览 • 0回复 待解决
HarmonyOS 怎么给H5传递JSONObject对象
527浏览 • 1回复 待解决
场景化控件中无法获取到定位信息
2173浏览 • 1回复 待解决
HarmonyOS 获取h5高度和宽度
463浏览 • 1回复 待解决
HarmonyOS ArkTS和h5数据解析
546浏览 • 1回复 待解决
HarmonyOS H5页面localstoragenull
597浏览 • 1回复 待解决
HarmonyOS web通过loadData加载h5标签
1085浏览 • 1回复 待解决
HarmonyOS h5拉起app,如何获取参数
431浏览 • 1回复 待解决
HarmonyOS H5和应用侧数据交互
1030浏览 • 1回复 待解决
HarmonyOS H5与应用侧数据交互Demo
1219浏览 • 1回复 待解决
HarmonyOS 通过webview改变H5页面字体
590浏览 • 1回复 待解决
HarmonyOS webview h5localstorage
785浏览 • 1回复 待解决