openharmony 鸿蒙 js-apis-inner-notification-notificationRequest-sys

2025-06-16 浏览 (1)

NotificationRequest(系统接口)

描述通知的请求。

说明:

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

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

NotificationRequest

系统能力:SystemCapability.Notification.Notification

名称类型只读可选说明
overlayIcon11+image.PixelMap通知重叠图标。可选字段,图像像素的总字节数不超过100KB。
系统接口:此接口为系统接口。
classificationstring通知分类。
系统接口:此接口为系统接口。预留能力,暂未支持。
isRemoveAllowed8+boolean通知是否能被移除(点击通知下方删除按钮无法删除,左滑不出现删除按钮)。默认为false。
- true:是。
- false:否。
系统接口:此接口为系统接口。
需要权限:ohos.permission.SET_UNREMOVABLE_NOTIFICATION
source8+number通知源。
系统接口:此接口为系统接口。预留能力,暂未支持。
deviceId8+string通知源的deviceId。
系统接口:此接口为系统接口。预留能力,暂未支持。
representativeBundle12+BundleOption被代理的包信息。
系统接口:此接口为系统接口。
notificationControlFlags12+number通知提醒方式管控。
可以通过此接口减少当前通知的提醒方式。与NotificationControlFlagStatus的枚举进行按位或运算得到该参数。
系统接口:此接口为系统接口。
unifiedGroupInfo12+UnifiedGroupInfo消息智能聚合信息字段。
系统接口:此接口为系统接口。
creatorInstanceKey(deprecated)number创建者实例键值。
系统接口:此接口为系统接口。
agentBundle12+BundleOption创建通知的代理包信息。
系统接口:此接口为系统接口。
appInstanceKey15+string应用实例键值。
系统接口:此接口为系统接口。
notDistributed18+boolean通知是否不进行全场景跨设备协同显示,默认为false。
说明:
该字段与forceDistributed字段互斥,当两者同时配置时,仅notDistributed字段生效。
- 设置为true时:通知仅在本设备上显示。
- 设置为false时:通知将在所有协同设备上显示。
系统接口: 此接口为系统接口。
forceDistributed18+boolean通知是否强制进行全场景跨设备协同显示,默认为false。
说明:
仅当应用在跨设备协同管控名单中且未配置notDistributed字段时,该字段才会生效。通过读取notification_config.json文件(文件配置路径见:notification_config_parse.h 中的NOTIFICAITON_CONFIG_FILE属性)中的collaborationFilter字段,查看是否包含应用的UID或包名。如果包含,说明是在应用跨设备协同管控名单中。
- 设置为true时:通知将在所有协同设备上显示。
- 设置为false时:通知将按照协同管控名单显示。
系统接口: 此接口为系统接口。

DistributedOptions8+

描述分布式选项。

系统能力:SystemCapability.Notification.Notification

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

NotificationFilter11+

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

系统能力:SystemCapability.Notification.Notification

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

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

NotificationCheckRequest11+

描述通知的鉴权信息。

系统能力:SystemCapability.Notification.Notification

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

名称类型必填说明
contentTypeContentType通知类型。
slotTypeSlotType渠道类型。
extraInfoKeysArray<string>实况通知的附加信息。

UnifiedGroupInfo12+

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

系统能力:SystemCapability.Notification.Notification

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

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

你可能感兴趣的鸿蒙文章

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

harmony 鸿蒙Notification

harmony 鸿蒙通知错误码

harmony 鸿蒙NotificationActionButton

harmony 鸿蒙NotificationCommonDef

harmony 鸿蒙NotificationContent(系统接口)

harmony 鸿蒙NotificationContent

harmony 鸿蒙NotificationFlags(系统接口)

harmony 鸿蒙NotificationFlags

harmony 鸿蒙NotificationRequest

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/1BIxFk