• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NotificationRequest
2
3描述通知的请求。
4
5> **说明:**
6>
7> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
8
9**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
10
11| 名称                  | 类型                                          | 可读 | 可写 | 说明                       |
12| --------------------- | --------------------------------------------- | ---- | --- | -------------------------- |
13| content               | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent)   | 是  | 是  | 通知内容。                   |
14| id                    | number                                        | 是  | 是  | 通知ID。                     |
15| slotType              | [SlotType](js-apis-notificationManager.md#slottype)                         | 是  | 是  | 通道类型。                   |
16| isOngoing             | boolean                                       | 是  | 是  | 是否进行时通知。             |
17| isUnremovable         | boolean                                       | 是  | 是  | 是否可移除。                 |
18| deliveryTime          | number                                        | 是  | 是  | 通知发送时间。               |
19| tapDismissed          | boolean                                       | 是  | 是  | 通知是否自动清除。           |
20| autoDeletedTime       | number                                        | 是  | 是  | 自动清除的时间。             |
21| wantAgent             | [WantAgent](js-apis-app-ability-wantAgent.md) | 是  | 是  | WantAgent封装了应用的行为意图,点击通知时触发该行为。 |
22| extraInfo             | {[key: string]: any}                          | 是  | 是  | 扩展参数。                   |
23| color                 | number                                        | 是  | 是  | 通知背景颜色。预留能力,暂未支持。 |
24| colorEnabled          | boolean                                       | 是  | 是  | 通知背景颜色是否使能。预留能力,暂未支持。 |
25| isAlertOnce           | boolean                                       | 是  | 是  | 设置是否仅有一次此通知提醒。 |
26| isStopwatch           | boolean                                       | 是  | 是  | 是否显示已用时间。           |
27| isCountDown           | boolean                                       | 是  | 是  | 是否显示倒计时时间。         |
28| isFloatingIcon        | boolean                                       | 是  | 是  | 是否显示状态栏图标。         |
29| label                 | string                                        | 是  | 是  | 通知标签。                   |
30| badgeIconStyle        | number                                        | 是  | 是  | 通知角标类型。               |
31| showDeliveryTime      | boolean                                       | 是  | 是  | 是否显示分发时间。           |
32| actionButtons         | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\>             | 是  | 是  | 通知按钮,最多三个按钮。  |
33| smallIcon             | [image.PixelMap](js-apis-image.md#pixelmap7) | 是  | 是  | 通知小图标。可选字段,大小不超过30KB。 |
34| largeIcon             | [image.PixelMap](js-apis-image.md#pixelmap7) | 是  | 是  | 通知大图标。可选字段,大小不超过30KB。 |
35| creatorBundleName     | string                                        | 是  | 否  | 创建通知的包名。             |
36| creatorUid<sup>8+<sup>  | number                                        | 是  | 否  | 创建通知的UID。              |
37| creatorPid            | number                                        | 是  | 否  | 创建通知的PID。              |
38| creatorUserId| number                                    | 是  | 否  | 创建通知的UserId。           |
39| hashCode              | string                                        | 是  | 否  | 通知唯一标识。               |
40| classification        | string                                        | 是  | 是  | 通知分类。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。                   |
41| groupName<sup>8+<sup> | string                                        | 是  | 是  | 组通知名称。                 |
42| template<sup>8+<sup> | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | 是  | 是  | 通知模板。                   |
43| isRemoveAllowed<sup>8+<sup> | boolean                                | 是  | 否  | 通知是否能被移除。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。                   |
44| source<sup>8+<sup> | number                                        | 是  | 否  | 通知源。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。                   |
45| distributedOption<sup>8+<sup> | [DistributedOptions](#distributedoptions)                 | 是  | 是  | 分布式通知的选项。          |
46| deviceId<sup>8+<sup> | string                                        | 是  | 否  | 通知源的deviceId。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。          |
47| notificationFlags<sup>8+<sup> | [NotificationFlags](js-apis-inner-notification-notificationflags#notificationFlags)                    | 是  | 否  | 获取NotificationFlags。          |
48| removalWantAgent<sup>9+<sup> | [WantAgent](js-apis-app-ability-wantAgent.md) | 是  | 是  | 当移除通知时,通知将被重定向到的WantAgent实例。          |
49| badgeNumber<sup>9+<sup> | number                    | 是  | 是  | 应用程序图标上显示的通知数。          |
50
51
52## DistributedOptions
53
54描述分布式选项。
55
56**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
57
58| 名称                   | 类型            | 可读 | 可写 | 说明                               |
59| ---------------------- | -------------- | ---- | ---- | ---------------------------------- |
60| isDistributed<sup>8+<sup>          | boolean        | 是   | 是   | 是否为分布式通知。                  |
61| supportDisplayDevices<sup>8+<sup>  | Array\<string> | 是   | 是   | 可以同步通知到的设备列表。         |
62| supportOperateDevices<sup>8+<sup>  | Array\<string> | 是   | 是   | 可以打开通知的设备列表。              |
63| remindType<sup>8+<sup>             | number         | 是   | 否   | 通知的提醒方式。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。                    |
64