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