module.json5配置权限
"requestPermissions": [
{
"name": "ohos.permission.APPROXIMATELY_LOCATION",
"reason": "$string:location_tips",
"usedScene": {
"when": "inuse"
}
},
{
"name": "ohos.permission.LOCATION",
"reason": "$string:location_tips",
"usedScene": {
"when": "inuse"
}
}
]
页面使用:
uni.getLocation({
type: 'wgs84',
geocode: true,
isHighAccuracy: true,
success: function(res) {
_this.longitude = res.longitude
_this.latitude = res.latitude
console.log('location===', JSON.stringify(res));
},
啾啾 (作者)
uni-im里发了你一个视频,麻烦帮忙看下
2024-10-29 13:55
啾啾 (作者)
不止定位权限,录音权限也一样,可能权限都有这个问题
2024-10-29 13:59