1、判断位置开关是否开启:geoLocationManager.isLocationEnabled参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-geolocationmanager-V5\#geolocationmanagerislocationenabled2、拉起方需要申请 ohos.permission.GRANT\_SENSITIVE\_PERMISSIONS权限参考DEMO如下:import { common } from '@kit.AbilityKit'; @Entry @Component struct Index { @State message: string = 'Hello World'; openAppInfo() { let context = getContext(this) as common.UIAbilityContext; context.startAbility({ bundleName: 'com.huawei.hmos.settings', abilityName: 'com.huawei.hmos.settings.MainAbility', uri: 'application_info_entry', parameters: { pushParams: "com.example.uiabilitycontext" } }); } build() { Row() { Column() { Button('123').onClick(() => { this.openAppInfo() }) } .width('100%') } .height('100%') } }pushParams: "com.example.uiabilitycontext"这个是具体的app名称,可查看app.json5文件
1、判断位置开关是否开启:geoLocationManager.isLocationEnabled
参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-geolocationmanager-V5\#geolocationmanagerislocationenabled
2、拉起方需要申请 ohos.permission.GRANT\_SENSITIVE\_PERMISSIONS权限
参考DEMO如下:
pushParams: "com.example.uiabilitycontext"这个是具体的app名称,可查看app.json5文件