1# NotificationContent 2 3The **NotificationContent** module provides APIs for defining the notification content. 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## NotificationContent 10 11**System capability**: SystemCapability.Notification.Notification 12 13| Name | Type | Read Only | Optional | Description | 14| ----------- | --------------------------------------------------------------------------- | ---- | --- | ------------------ | 15| contentType<sup>(deprecated)</sup> | [notification.ContentType](./js-apis-notification.md#contenttype) | No | Yes | Notification content type.<br>This API is deprecated since API version 11. You are advised to use **notificationContentType** instead. | 16| notificationContentType<sup>11+</sup> | [notificationManager.ContentType](./js-apis-notificationManager.md#contenttype) | No | Yes | Notification content type. | 17| normal | [NotificationBasicContent](#notificationbasiccontent) | No | Yes | Normal text. | 18| longText | [NotificationLongTextContent](#notificationlongtextcontent) | No | Yes | Long text. | 19| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | No | Yes | Multi-line text. | 20| picture | [NotificationPictureContent](#notificationpicturecontent) | No | Yes | Picture-attached. | 21| systemLiveView<sup>11+</sup> | [NotificationSystemLiveViewContent](#notificationsystemliveviewcontent) | No | Yes | System live view. A third-party application cannot directly create a notification of this type. After the system proxy creates a system live view, the third-party application releases a notification with the same ID to update the specified content.| 22 23## NotificationBasicContent 24 25Describes the normal text notification. 26 27**System capability**: SystemCapability.Notification.Notification 28 29| Name | Type | Read Only | Optional | Description | 30| -------------- | ------ | ---- |-----| ---------------------------------- | 31| title | string | No | No | Notification title. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 32| text | string | No | No | Notification content. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 33| additionalText | string | No | Yes | Additional information of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 34| lockscreenPicture<sup>12+</sup> | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | Yes | Picture of a notification displayed on the lock screen. | 35 36## NotificationLongTextContent 37 38Describes the long text notification. 39 40> **NOTE** 41> 42> The display effect depends on the device capability and notification center UI style. 43 44**System capability**: SystemCapability.Notification.Notification 45 46| Name | Type | Read Only | Optional | Description | 47| -------------- | ------ | ---- | --- | -------------------------------- | 48| title | string | No | No | Notification title. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 49| text | string | No | No | Notification content. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 50| additionalText | string | No | Yes | Additional information of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 51| lockscreenPicture<sup>12+</sup> | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | No | Picture of a notification displayed on the lock screen. | 52| longText | string | No | No | Long text of the notification. It cannot be an empty string and exceed 1024 bytes. Excess content will be truncated. | 53| briefText | string | No | No | Brief text of the notification. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 54| expandedTitle | string | No | No | Title of the notification in the expanded state. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 55 56 57## NotificationMultiLineContent 58 59Describes the multi-line text notification. 60 61> **NOTE** 62> 63> The display effect depends on the device capability and notification center UI style. 64 65**System capability**: SystemCapability.Notification.Notification 66 67| Name | Type | Read Only | Optional | Description | 68| -------------- | --------------- | --- | --- | -------------------------------- | 69| title | string | No | No | Notification title. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 70| text | string | No | No | Notification content. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 71| additionalText | string | No | Yes | Additional information of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 72| lockscreenPicture<sup>12+</sup> | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | No | Picture of a notification displayed on the lock screen. | 73| briefText | string | No | No | Brief text of the notification. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 74| longTitle | string | No | No | Title of the notification in the expanded state. It cannot be empty or exceed 200 bytes. Excess content will be truncated.| 75| lines | Array\<string\> | No | No | Multi-line text of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 76 77 78## NotificationPictureContent 79 80Describes the picture-attached notification. 81 82> **NOTE** 83> 84> The display effect depends on the device capability and notification center UI style. 85 86**System capability**: SystemCapability.Notification.Notification 87 88| Name | Type | Read Only | Optional | Description | 89| -------------- | -------------------------------------------- | ---- | --- |------------------------------------| 90| title | string | No | No | Notification title. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 91| text | string | No | No | Notification content. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 92| additionalText | string | No | Yes | Additional information of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 93| lockscreenPicture<sup>12+</sup> | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | No | Picture of a notification displayed on the lock screen. | 94| briefText | string | No | No | Brief text of the notification. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 95| expandedTitle | string | No | No | Title of the notification in the expanded state. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 96| picture | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | No | Picture content of the notification. (The total number of bytes of image pixels cannot exceed 2 MB.)| 97 98 99## NotificationSystemLiveViewContent 100 101Describes the system live view notification. A third-party application cannot directly create a notification of this type. After the system proxy creates a system live view, the third-party application releases a notification with the same ID to update the specified content. 102 103**System capability**: SystemCapability.Notification.Notification 104 105| Name | Type | Read Only | Optional | Description | 106| ---------------------------- | ----------------------------------------------- | --- | --- | -----------------------------------| 107| title | string | No | No | Notification title. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 108| text | string | No | No | Notification content. It cannot be empty or exceed 200 bytes. Excess content will be truncated. | 109| additionalText | string | No | Yes | Additional information of the notification. It cannot exceed 200 bytes. Excess content will be truncated. | 110| lockscreenPicture<sup>12+</sup> | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | Yes | Picture of a notification displayed on the lock screen. | 111| typeCode<sup>11+</sup> | number | No | No | Type code, which identifies the type of the service that invokes the API. | 112| capsule<sup>11+</sup> | [NotificationCapsule](#notificationcapsule11) | No | Yes | Capsule of the notification. | 113| button<sup>11+</sup> | [NotificationButton](#notificationbutton11) | No | Yes | Button in the notification. | 114| time<sup>11+</sup> | [NotificationTime](#notificationtime11) | No | Yes | Time of the notification. | 115| progress<sup>11+</sup> | [NotificationProgress](#notificationprogress11) | No | Yes | Progress of the notification. | 116 117 118## NotificationCapsule<sup>11+</sup> 119 120Describe the notification capsule. 121 122**System capability**: SystemCapability.Notification.Notification 123 124| Name | Type | Read Only | Optional | Description | 125| --------------- | -------------------------------------------- | --- | --- | -------------------------------- | 126| title | string | No | Yes | Title of the capsule. | 127| icon | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7) | No | Yes | Icon of the capsule. | 128| backgroundColor | string | No | Yes | Background color of the capsule. | 129 130 131## NotificationButton<sup>11+</sup> 132 133Describes the notification button. 134 135**System capability**: SystemCapability.Notification.Notification 136 137| Name | Type | Read Only | Optional | Description | 138| ----- | ----------------------------------------------------- | --- | --- | ----------------- | 139| names | Array\<string\> | No | Yes | Button names. A maximum of three names are supported. | 140| icons | Array\<[image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7)\> | No | Yes | Button icons. A maximum of three icons are supported. | 141| iconsResource | Array\<[Resource](../apis-arkui/arkui-ts/ts-types.md#resource)\> | No | Yes | Button icon resources. A maximum of three icon resources are supported. | 142 143## NotificationTime<sup>11+</sup> 144 145Describes the notification time. 146 147**System capability**: SystemCapability.Notification.Notification 148 149| Name | Type | Read Only | Optional | Description | 150| -------------- | ---------------- | --- | --- | -------------------------------- | 151| initialTime | number | No | Yes | Start time. | 152| isCountDown | boolean | No | Yes | Whether to count down. | 153| isPaused | boolean | No | Yes | Whether to pause the progress. | 154| isInTitle | boolean | No | Yes | Whether the time is displayed in the title. | 155 156 157## NotificationProgress<sup>11+</sup> 158 159Describes the notification progress. 160 161**System capability**: SystemCapability.Notification.Notification 162 163| Name | Type | Read Only | Optional | Description | 164| -------------- | --------------- | --- | --- | -------------------------------- | 165| maxValue | number | No | Yes | Maximum progress value. | 166| currentValue | number | No | Yes | Current progress value. | 167| isPercentage | boolean | No | Yes | Whether to show the progress in percentage. | 168