6131903e创建于 2025年3月1日历史提交

NotificationRequest(系统接口)

描述通知的请求。

说明:

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

当前界面仅包含本模块的系统接口,其他公开接口参见NotificationRequest

NotificationRequest

系统能力:SystemCapability.Notification.Notification

名称 类型 只读 可选 说明
overlayIcon11+ image.PixelMap 通知重叠图标。可选字段,图像像素的总字节数不超过100KB。
系统接口:此接口为系统接口。
classification string 通知分类。
系统接口:此接口为系统接口。预留能力,暂未支持。
isRemoveAllowed8+ boolean 通知是否能被移除(点击通知下方删除按钮无法删除,左滑不出现删除按钮)。
系统接口:此接口为系统接口。
需要权限:ohos.permission.SET_UNREMOVABLE_NOTIFICATION
source8+ number 通知源。
系统接口:此接口为系统接口。预留能力,暂未支持。
deviceId8+ string 通知源的deviceId。
系统接口:此接口为系统接口。预留能力,暂未支持。
representativeBundle12+ BundleOption 被代理的包信息。
系统接口:此接口为系统接口。
notificationControlFlags12+ number 通知提醒方式管控。
可以通过此接口减少当前通知的提醒方式。与NotificationControlFlagStatus的枚举进行按位或运算得到该参数。
系统接口:此接口为系统接口。
unifiedGroupInfo12+ UnifiedGroupInfo 消息智能聚合信息字段。
系统接口:此接口为系统接口。
creatorInstanceKey(deprecated) number 创建者实例键值。
系统接口:此接口为系统接口。
agentBundle12+ BundleOption 创建通知的代理包信息。
系统接口:此接口为系统接口。
appInstanceKey15+ string 应用实例键值。
系统接口:此接口为系统接口。

DistributedOptions8+

描述分布式选项。

系统能力:SystemCapability.Notification.Notification

名称 类型 必填 说明
remindType number 通知的提醒方式。
系统接口:此接口为系统接口。

NotificationFilter11+

描述查询普通实况窗时的筛选条件。

系统能力:SystemCapability.Notification.Notification

系统接口:此接口为系统接口。

名称 类型 必填 说明
bundle BundleOption 实况通知的包信息。
notificationKey NotificationKey 通知信息,包含通知ID和通知标签。
extraInfoKeys Array<string> 筛选附加信息的键值列表。不填表示查询所有的附加信息。

NotificationCheckRequest11+

描述通知的鉴权信息。

系统能力:SystemCapability.Notification.Notification

系统接口:此接口为系统接口。

名称 类型 必填 说明
contentType ContentType 通知类型。
slotType SlotType 渠道类型。
extraInfoKeys Array<string> 实况通知的附加信息。

UnifiedGroupInfo12+

描述通知智能聚合信息字段。

系统能力:SystemCapability.Notification.Notification

系统接口:此接口为系统接口。

名称 类型 必填 说明
key string 聚合组ID。
title string 聚合组标题。
content string 聚合组摘要正文。
sceneName string 聚合场景名称。
extraInfo {[key: string]: any} 其他聚合信息。