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

HarmonyOS
2024-12-17 13:55:24
浏览
收藏 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"
  }
}
分享
微博
QQ
微信
回复
2024-12-17 16:05:20
相关问题
HarmonyOS 系统剪切板获取到数据
1018浏览 • 1回复 待解决
sim.getOpNameSync获取到
1074浏览 • 0回复 待解决
HarmonyOS 怎么给H5传递JSONObject对象
1060浏览 • 1回复 待解决
HarmonyOS 获取h5高度和宽度
1078浏览 • 1回复 待解决
HarmonyOS H5页面localstoragenull
1327浏览 • 1回复 待解决
HarmonyOS ArkTS和h5数据解析
1069浏览 • 1回复 待解决
场景化控件中无法获取到定位信息
2807浏览 • 1回复 待解决
HarmonyOS web通过loadData加载h5标签
1648浏览 • 1回复 待解决
HarmonyOS h5拉起app,如何获取参数
945浏览 • 1回复 待解决
HarmonyOS H5和应用侧数据交互
1689浏览 • 1回复 待解决
HarmonyOS 通过webview改变H5页面字体
1421浏览 • 1回复 待解决
HarmonyOS H5与应用侧数据交互Demo
1809浏览 • 1回复 待解决
HarmonyOS webview h5localstorage
1341浏览 • 1回复 待解决