• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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| Mandatory| Description              |
14| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ |
15| contentType | [ContentType](./js-apis-notificationManager.md#contenttype)  | No | Yes | Notification content type.      |
16| normal      | [NotificationBasicContent](#notificationbasiccontent)        | No | No | Normal text.  |
17| longText    | [NotificationLongTextContent](#notificationlongtextcontent)  | No | No | Long text.|
18| multiLine   | [NotificationMultiLineContent](#notificationmultilinecontent) | No | No | Multi-line text.  |
19| picture     | [NotificationPictureContent](#notificationpicturecontent)    | No | No | Picture-attached.  |
20
21## NotificationBasicContent
22
23Describes the normal text notification.
24
25**System capability**: SystemCapability.Notification.Notification
26
27| Name          | Type  | Mandatory| Description                              |
28| -------------- | ------ | ---- | ---------------------------------- |
29| title          | string | Yes  | Notification title.                        |
30| text           | string | Yes  | Notification content.                        |
31| additionalText | string | No  | Additional information of the notification.|
32
33
34## NotificationLongTextContent
35
36Describes the long text notification.
37
38**System capability**: SystemCapability.Notification.Notification
39
40| Name          | Type  | Mandatory| Description                            |
41| -------------- | ------ | --- | -------------------------------- |
42| title          | string | Yes | Notification title.                        |
43| text           | string | Yes | Notification content.                        |
44| additionalText | string | No | Additional information of the notification.  |
45| longText       | string | Yes | Long text of the notification.                    |
46| briefText      | string | Yes | Brief text of the notification.  |
47| expandedTitle  | string | Yes | Title of the notification in the expanded state.                |
48
49
50## NotificationMultiLineContent
51
52Describes the multi-line text notification.
53
54**System capability**: SystemCapability.Notification.Notification
55
56| Name          | Type           | Readable| Writable| Description                            |
57| -------------- | --------------- | --- | --- | -------------------------------- |
58| title          | string          | No | Yes | Notification title.                        |
59| text           | string          | No | Yes | Notification content.                        |
60| additionalText | string          | No | No | Additional information of the notification.|
61| briefText      | string          | No | Yes | Brief text of the notification.|
62| longTitle      | string          | No | Yes | Title of the notification in the expanded state.                |
63| lines          | Array\<string\> | No | Yes | Multi-line text of the notification.                  |
64
65
66## NotificationPictureContent
67
68Describes the picture-attached notification.
69
70**System capability**: SystemCapability.Notification.Notification
71
72| Name          | Type          | Readable| Writable| Description         |
73| -------------- | -------------- | ---- | --- |-------------|
74| title          | string         | No | Yes | Notification title.      |
75| text           | string         | No | Yes | Notification content.      |
76| additionalText | string         | No | No | Additional information of the notification.|
77| briefText      | string         | No | Yes | Brief text of the notification.|
78| expandedTitle  | string         | No | Yes | Title of the notification in the expanded state.  |
79| picture        | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Yes | Picture attached to the notification. The maximum size is 2 MB. |
80