HarmonyOS NEXT API12 如何跳转到应用权限设置页面
HarmonyOS NEXT API12 如何跳转到应用权限设置页面呢,代码如下: 注意:下面代码中的应用包名需要改成你自己的应用包名,必须配置对
let want: Want = {
bundleName: 'com.huawei.hmos.settings',
abilityName: 'com.huawei.hmos.settings.MainAbility',
uri: 'application_info_entry',
parameters: {
pushParams: '应用包名'
}
}
context.startAbility(wantInfo).then(() => {
console.log('location open setting page')
}).catch((err:object) => {
console.log('location open setting page failed')
})