可以使用二次申请授权接口,通过调用requestPermissionOnSetting()直接拉起权限设置弹框,引导用户授予权限https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/request-user-authorization-second-V5Button("系统通知设置页").onClick(()=> { let context = getContext(this) as common.UIAbilityContext; let want: Want = { bundleName: 'com.huawei.hmos.settings', abilityName: 'com.huawei.hmos.settings.MainAbility', uri: "'application_info_entry", parameters: { pushParams: { bundleName: "" } // 应用包名 } } context.startAbility(want) })
可以使用二次申请授权接口,通过调用requestPermissionOnSetting()直接拉起权限设置弹框,引导用户授予权限
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/request-user-authorization-second-V5