HarmonyOS鸿蒙Next中华为push通知栏如何实现默认置顶
HarmonyOS鸿蒙Next中华为push通知栏如何实现默认置顶 在鸿蒙NEXT系统和鸿蒙OS系统(非NEXT)上实现功能,推送重要推送消息,手机收到通知栏默认是置顶的,不要用户自己设置置顶。
1 回复
更多关于HarmonyOS鸿蒙Next中华为push通知栏如何实现默认置顶的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
非常抱歉,目前没有相关API设置通知消息默认置顶。 通知中心:通知浏览界面,通知在通知中心中根据类别排序,每个类别内按时间排序。 参考链接:https://developer.huawei.com/consumer/cn/doc/design-guides/system-features-notification-0000001793074217#section3978174911409
也可以引导用户在设置中通知管理页面开启置顶显示通知。需要取决于用户自己的选择。 跳转设置中app通知管理
Button("通知管理").onClick(()=> {
let context = getContext(this) as common.UIAbilityContext;
let want: Want = {
bundleName: 'com.huawei.hmos.settings',
abilityName: 'com.huawei.hmos.settings.MainAbility',
uri: 'systemui_notification_settings',
parameters: {
pushParams: {
bundleName: context.abilityInfo.bundleName // 应用包名
}
}
};
context.startAbility(want);
}).margin(10)