Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_push
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
顾海波
2025-08-21 14:19:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8463510f0b0892c23842b06b0f57633f4257c59c
8463510f
1 parent
fc6ce271
【修复】鸿蒙跳转打开通知权限
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
ohos/src/main/ets/com/ewin/flutter_push/PushPluginMethodChannelHandler.ets
ohos/src/main/ets/com/ewin/flutter_push/PushPluginMethodChannelHandler.ets
View file @
8463510
...
...
@@ -74,11 +74,8 @@ export default class PushPluginMethodChannelHandler implements MethodCallHandler
notificationManager.requestEnableNotification(context).then(() => {
result.success(true)
}).catch((err : BusinessError) => {
if(1600004 == err.code){
result.error(`${err.code}`,`${err.message}`,"")
} else {
result.error(`${err.code}`,`${err.message}`,"")
}
this.openPermissionsInSystemSettings(context, context.applicationInfo.name)
result.success(true)
});
}
}).catch((err : BusinessError) => {
...
...
@@ -86,6 +83,20 @@ export default class PushPluginMethodChannelHandler implements MethodCallHandler
});
}
openPermissionsInSystemSettings(context: common.UIAbilityContext, bundleName: string): void {
let wantInfo: Want = {
bundleName: 'com.huawei.hmos.settings',
abilityName: 'com.huawei.hmos.settings.MainAbility',
uri: 'systemui_notification_settings',
parameters: {
pushParams: {
bundleName: bundleName // 应用包名
}
}
};
context.startAbility(wantInfo);
}
async init(result: MethodResult): Promise<void> {
try {
...
...
Please
register
or
login
to post a comment