harmony 鸿蒙NotificationSlot

  • 2025-06-16
  • 浏览 (6)

NotificationSlot

描述通知槽。

说明:

本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。

NotificationSlot

系统能力: SystemCapability.Notification.Notification

名称 类型 只读 可选 说明
type(deprecated) notification.SlotType 通道类型。
从API version 11开始不再维护,建议使用notificationType代替。
notificationType11+ notificationManager.SlotType 通道类型。
level notification.SlotLevel 通知级别。
desc string 通知渠道描述信息。
badgeFlag boolean 是否显示角标。
- true:是。
- false:否。
bypassDnd boolean 是否在系统中绕过免打扰模式。
- true:是。
- false:否。
lockscreenVisibility number 在锁定屏幕上显示通知的模式。预留能力,暂不支持。
vibrationEnabled boolean 是否可振动。
- true:是。
- false:否。
sound string 该渠道的通知的自定义铃声文件名。该文件放在resources/rawfile目录下,支持m4a、aac、mp3、ogg、wav、flac、amr等格式。
lightEnabled boolean 是否闪灯。
- true:是。
- false:否。
lightColor number 通知灯颜色。预留能力,暂不支持。
vibrationValues Array<number> 通知振动样式。预留能力,暂不支持。
enabled9+ boolean 表示是否允许发布此通知渠道的通知。
- true:允许。
- false:禁止。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Notification Kit(用户通知服务)

harmony 鸿蒙Notification

harmony 鸿蒙通知错误码

harmony 鸿蒙NotificationActionButton

harmony 鸿蒙NotificationCommonDef

harmony 鸿蒙NotificationContent(系统接口)

harmony 鸿蒙NotificationContent

harmony 鸿蒙NotificationFlags(系统接口)

harmony 鸿蒙NotificationFlags

harmony 鸿蒙NotificationRequest(系统接口)

0  赞