1# NotificationRequest(系统接口) 2<!--Kit: Notification Kit--> 3<!--Subsystem: Notification--> 4<!--Owner: @michael_woo888--> 5<!--Designer: @dongqingran; @wulong158--> 6<!--Tester: @wanghong1997--> 7<!--Adviser: @huipeizi--> 8 9描述通知的请求。 10 11> **说明:** 12> 13> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 14> 15> 当前界面仅包含本模块的系统接口,其他公开接口参见[NotificationRequest](./js-apis-inner-notification-notificationRequest.md)。 16 17## NotificationRequest 18 19**系统能力**:SystemCapability.Notification.Notification 20 21| 名称 | 类型 | 只读 | 可选 | 说明 | 22|-------------------------------| -------------------------------------------------------- | ----- | --- |-----------------------------------------------------------------------| 23| overlayIcon<sup>11+</sup> | [image.PixelMap](../apis-image-kit/arkts-apis-image-PixelMap.md) | 否 | 是 | 通知重叠图标。图像像素的总字节数不超过192KB。<br>**系统接口**:此接口为系统接口。 | 24| classification | string | 否 | 是 | 通知分类。<br>**系统接口**:此接口为系统接口。预留能力,暂未支持。 | 25| isRemoveAllowed<sup>8+</sup> | boolean | 否 | 是 | 通知是否能被移除(点击通知下方删除按钮无法删除,左滑不出现删除按钮)。默认为false。<br> - true:是。<br> - false:否。<br>**系统接口**:此接口为系统接口。<br>**需要权限**:ohos.permission.SET_UNREMOVABLE_NOTIFICATION | 26| source<sup>8+</sup> | number | 是 | 是 | 通知源。<br>**系统接口**:此接口为系统接口。预留能力,暂未支持。 | 27| deviceId<sup>8+</sup> | string | 是 | 是 | 通知源的deviceId。<br>**系统接口**:此接口为系统接口。预留能力,暂未支持。 | 28| representativeBundle<sup>12+</sup> | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 否 | 是 | 被代理的包信息。<br>**系统接口**:此接口为系统接口。 | 29| notificationControlFlags<sup>12+</sup> | number | 否 | 是 | 通知提醒方式管控。<br>可以通过此接口减少当前通知的提醒方式。与[NotificationControlFlagStatus](js-apis-notificationManager-sys.md#notificationcontrolflagstatus12)的枚举进行按位或运算得到该参数。<br>**系统接口**:此接口为系统接口。 | 30| unifiedGroupInfo<sup>12+</sup> | [UnifiedGroupInfo](#unifiedgroupinfo12) | 否 | 是 |消息智能聚合信息字段。 <br>**系统接口**:此接口为系统接口。| 31| creatorInstanceKey<sup>(deprecated)</sup> | number | 是 | 是 | 创建者实例键值。 <br>**系统接口**:此接口为系统接口。| 32| agentBundle<sup>12+</sup> | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 是 | 创建通知的代理包信息。 <br>**系统接口**:此接口为系统接口。| 33| appInstanceKey<sup>15+</sup> | string | 是 | 是 | 应用实例键值。 <br>**系统接口**:此接口为系统接口。| 34| notDistributed<sup>18+</sup> | boolean | 否 | 是 | 通知是否不进行全场景跨设备协同显示,默认为false。<br/>**说明**:<br/>该字段与forceDistributed字段互斥,当两者同时配置时,仅notDistributed字段生效。<br/>- 设置为true时:通知仅在本设备上显示。<br/>- 设置为false时:通知将在所有协同设备上显示。<br>**系统接口**: 此接口为系统接口。 | 35| forceDistributed<sup>18+</sup> | boolean | 否 | 是 | 通知是否强制进行全场景跨设备协同显示,默认为false。<br/>**说明**:<br/>仅当应用在跨设备协同管控名单中且未配置notDistributed字段时,该字段才会生效。通过读取notification_config.json文件(文件配置路径见:[notification_config_parse.h](https://gitee.com/openharmony/notification_distributed_notification_service/blob/master/services/ans/include/notification_config_parse.h) 中的NOTIFICAITON_CONFIG_FILE属性)中的collaborationFilter字段,查看是否包含应用的UID或包名。如果包含,说明是在应用跨设备协同管控名单中。<br>- 设置为true时:通知将在所有协同设备上显示。<br/>- 设置为false时:通知将按照协同管控名单显示。<br>**系统接口**: 此接口为系统接口。 | 36| extendInfo<sup>20+</sup> | Record<string, Object> | 否 | 是 | 系统应用发布通知时的自定义扩展参数。<br>**系统接口**: 此接口为系统接口。 | 37 38## DistributedOptions<sup>8+</sup> 39 40描述分布式选项。 41 42**系统能力**:SystemCapability.Notification.Notification 43 44| 名称 | 类型 | 只读 | 可选 | 说明 | 45| ---------------------- | -------------- | ---- | ---- | ---------------------------------- | 46| remindType | number | 是 | 是 | 通知的提醒方式。<br>**系统接口**:此接口为系统接口。 | 47 48 49## NotificationFilter<sup>11+</sup> 50 51描述查询普通实况窗时的筛选条件。 52 53**系统能力**:SystemCapability.Notification.Notification 54 55**系统接口**:此接口为系统接口。 56 57| 名称 | 类型 | 只读 | 可选 | 说明 | 58| ----------------| ------------------------------------- | ---- | ---- | ---------------------------------- | 59| bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 否 | 否 | 实况通知的包信息。| 60| notificationKey | [notificationSubscribe.NotificationKey](js-apis-notificationSubscribe-sys.md#notificationkey) | 否 | 否 | 通知信息,包含通知ID和通知标签。 | 61| extraInfoKeys | Array\<string> | 否 | 是 | 筛选附加信息的键值列表。不填表示查询所有的附加信息。| 62 63 64## NotificationCheckRequest<sup>11+</sup> 65 66描述通知的鉴权信息。 67 68**系统能力**:SystemCapability.Notification.Notification 69 70**系统接口**:此接口为系统接口。 71 72| 名称 | 类型 | 只读 | 可选 | 说明 | 73| --------------| --------------------------------------------------------- | ---- | ---- | ----------------- | 74| contentType | [notificationManager.ContentType](js-apis-notificationManager.md#contenttype) | 否 | 否 | 通知类型。 | 75| slotType | [notificationManager.SlotType](js-apis-notificationManager.md#slottype) | 否 | 否 | 渠道类型。 | 76| extraInfoKeys | Array\<string> | 否 | 否 | 实况通知的附加信息。| 77 78## UnifiedGroupInfo<sup>12+</sup> 79 80描述通知智能聚合信息字段。 81 82**系统能力**:SystemCapability.Notification.Notification 83 84**系统接口**:此接口为系统接口。 85 86| 名称 | 类型 | 只读 | 可选 | 说明 | 87| ---------------------- | -------------- | ---- | ---- | ---------------------------------- | 88| key | string | 否 | 是 | 聚合组ID。 | 89| title | string | 否 | 是 | 聚合组标题。 | 90| content | string | 否 | 是 | 聚合组摘要正文。 | 91| sceneName | string | 否 | 是 | 聚合场景名称。 | 92| extraInfo | {[key: string]: any} | 否 | 是 | 其他聚合信息。 | 93