1# NotificationRequest 2 3The **NotificationRequest** module provides APIs for defining the notification request. 4 5> **NOTE** 6> 7> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9## NotificationRequest 10 11**System capability**: SystemCapability.Notification.Notification 12 13| Name | Type | Read Only| Optional| Description | 14|-------------------------------| -------------------------------------------------------- | ----- | --- |-----------------------------------------------------------------------| 15| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | No | No | Notification content. | 16| id | number | No | Yes | Notification ID. The default value is **0**. | 17| slotType<sup>(deprecated)</sup> | [notification.SlotType](./js-apis-notification.md#slottype) | No | Yes | Notification slot type.<br>This API is deprecated since API version 11. You are advised to use **notificationSlotType** instead. | 18| notificationSlotType<sup>11+</sup> | [notificationManager.SlotType](js-apis-notificationManager.md#slottype) | No | Yes | Notification slot type. | 19| isOngoing | boolean | No | Yes | Not supported currently. | 20| isUnremovable | boolean | No | Yes | Not supported currently. | 21| deliveryTime | number | No | Yes | Time when the notification is sent. This API is automatically generated by the system.<br>Data format: timestamp,<br>in milliseconds. | 22| tapDismissed | boolean | No | Yes | Whether the notification is automatically cleared. Not supported currently. | 23| autoDeletedTime | number | No | Yes | Time when the notification is automatically cleared.<br>Data format: timestamp,<br>in milliseconds.<br>For example, if a notification is to be cleared after being displayed for 3 seconds (3000 ms), you can configure **new Date().getTime() + 3000** to meet this requirement. | 24| wantAgent | [WantAgent](../apis-ability-kit/js-apis-app-ability-wantAgent.md) | No | Yes | **WantAgent** instance to which the notification will be redirected after being clicked. | 25| extraInfo | {[key: string]: any} | No | Yes | Extended parameters. | 26| color | number | No | Yes | Background color of the notification. Not supported currently. | 27| colorEnabled | boolean | No | Yes | Whether the notification background color can be enabled. Not supported currently. | 28| isAlertOnce | boolean | No | Yes | Whether the notification triggers an alert only once. | 29| isStopwatch | boolean | No | Yes | Whether to display the stopwatch. Not supported currently. | 30| isCountDown | boolean | No | Yes | Whether to display the countdown time. Not supported currently. | 31| isFloatingIcon | boolean | No | Yes | Whether the notification is displayed as a floating icon in the status bar. Not supported currently. | 32| label | string | No | Yes | Notification label.<br>The **label** field can be used independently, or used together with ID as a notification identifier. ID is preferentially used.<br>If the label is not empty when a notification is published, you need to specify the label when updating or deleting the notification. | 33| badgeIconStyle | number | No | Yes | Notification badge type. Not supported currently. | 34| showDeliveryTime | boolean | No | Yes | Whether to display the time when the notification is delivered. Not supported currently. | 35| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | No | Yes | Notification button. A notification can contain a maximum of two buttons. | 36| smallIcon | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | Yes | Small notification icon. Optional field. The total number of the icon pixel bytes cannot exceed 192 KB (which is obtained through [getPixelBytesNumber](../apis-image-kit/js-apis-image.md#getpixelbytesnumber7). The recommended icon size is 128 × 128 pixels. The display effect depends on the device capability and notification center UI style. | 37| largeIcon | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | Yes | Large notification icon. Optional field. The total number of the icon pixel bytes cannot exceed 192 KB (which is obtained through [getPixelBytesNumber](../apis-image-kit/js-apis-image.md#getpixelbytesnumber7). The recommended icon size is 128 × 128 pixels. The display effect depends on the device capability and notification center UI style. | 38| creatorBundleName | string | Yes | Yes | Name of the bundle that creates the notification. | 39| creatorUid | number | Yes | Yes | UID used for creating the notification. | 40| creatorPid | number | Yes | Yes | PID used for creating the notification. | 41| creatorUserId<sup>8+</sup> | number | Yes | Yes | ID of the user who creates the notification. | 42| hashCode | string | Yes | Yes | Unique ID of the notification. | 43| groupName<sup>8+</sup> | string | No | Yes | Notification group name. | 44| template<sup>8+</sup> | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | Yes | Notification template. | 45| distributedOption<sup>8+</sup> | [DistributedOptions](#distributedoptions8) | No | Yes | Distributed notification options. Not supported currently. | 46| notificationFlags<sup>8+</sup> | [NotificationFlags](js-apis-inner-notification-notificationFlags.md#notificationflags) | Yes | Yes | Notification flags. | 47| removalWantAgent<sup>9+</sup> | [WantAgent](../apis-ability-kit/js-apis-app-ability-wantAgent.md) | No | Yes | **WantAgent** instance to which the notification will be redirected when it is removed.<br>Currently, redirection to UIAbility is not supported. Only common events can be published (that is, [actionType](../apis-ability-kit/js-apis-inner-wantAgent-wantAgentInfo.md) is set to **4**). | 48| badgeNumber<sup>9+</sup> | number | No | Yes | Number of notifications displayed on the application icon. If the **badgeNumber** is set to **0**, badges are cleared; if the value is greater than **99**, **99+** is displayed on the badge. | 49| appMessageId<sup>12+</sup> | string | No | Yes | Unique ID carried in a notification sent by an app, which is used for notification deduplication. If an app publishes notifications with the same **appMessageId** locally or on the cloud, the device displays only one message. Repeated notifications received later will be silenced and deduplicated, and will not be displayed or notified. The deduplication flag is valid only within 24 hours after the notification is published. After 24 hours or the device is restarted, the deduplication flag becomes invalid. | 50| sound<sup>12+</sup> | string | No | Yes | Name of the custom ringtone file for application notifications. This file must be stored in the **resources/rawfile** directory and supports formats such as M4A, AAC, MP3, OGG, WAV, FLAC, and AMR. <!--RP1--> This field takes effect only after the system application with the [ohos.permission.NOTIFICATION_AGENT_CONTROLLER](../../security/AccessToken/permissions-for-system-apps.md#ohospermissionnotification_agent_controller) permission calls the [notificationManager.setAdditionalConfig](./js-apis-notificationManager-sys.md#notificationmanagersetadditionalconfig12) API to set additional configuration.<!--RP1End--> | 51 52## DistributedOptions<sup>8+</sup> 53 54Describes distributed notification options. 55 56**System capability**: SystemCapability.Notification.Notification 57 58| Name | Type | Read Only| Optional| Description | 59| -----------------------| -------------- | ---- | ---- | --------------------------------- | 60| isDistributed | boolean | No | Yes | Whether the notification is a distributed notification. | 61| supportDisplayDevices | Array\<string> | No | Yes | List of the devices to which the notification can be synchronized. | 62| supportOperateDevices | Array\<string> | No | Yes | List of the devices on which the notification can be opened. | 63