• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NotificationRequest (System API)
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> This topic describes only system APIs provided by the module. For details about its public APIs, see [NotificationRequest](./js-apis-inner-notification-notificationRequest.md).
10
11## NotificationRequest
12
13**System capability**: SystemCapability.Notification.Notification
14
15| Name                           | Type                                                   |  Read Only| Optional| Description                                                                   |
16|-------------------------------| -------------------------------------------------------- | ----- | --- |-----------------------------------------------------------------------|
17| overlayIcon<sup>11+</sup>      | [image.PixelMap](../apis-image-kit/js-apis-image.md#pixelmap7)             |   No | Yes | Notification overlay icon. This field is optional. The total number of bytes of image pixels cannot exceed 100 KB.<br>**System API**: This is a system API.                                                |
18| classification                | string                                                   |   No | Yes | Notification category.<br>**System API**: This is a system API. Not supported currently.                              |
19| isRemoveAllowed<sup>8+</sup>   | boolean                                                  |   No | Yes | Whether the notification can be removed. If a notification is not removable, it will not be deleted when the user touches the delete button below the notification, but it can still be deleted by swiping left on the notification and touching the delete button.<br>**System API**: This is a system API.<br>**Required permissions**: ohos.permission.SET_UNREMOVABLE_NOTIFICATION|
20| source<sup>8+</sup>            | number                                                   |   Yes | Yes | Notification source.<br>**System API**: This is a system API. Not supported currently.                               |
21| deviceId<sup>8+</sup>          | string                                                   |   Yes | Yes | Device ID of the notification source.<br>**System API**: This is a system API. Not supported currently.                      |
22| representativeBundle<sup>12+</sup> | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | No| Yes| Information about the proxied bundle.<br>**System API**: This is a system API.|
23| notificationControlFlags<sup>12+</sup>       | number                                                   |   No | Yes | Notification mode control.<br>This API can be used to reduce the notification modes of the current notification. This parameter is obtained by performing the bitwise OR operation with the enumeration of [NotificationControlFlagStatus](js-apis-notificationManager-sys.md#notificationcontrolflagstatus12).<br>**System API**: This is a system API.           |
24| unifiedGroupInfo<sup>12+</sup>       | [UnifiedGroupInfo](#unifiedgroupinfo12) |   No | Yes |Intelligent notification unification information.<br>**System API**: This is a system API.|
25| creatorInstanceKey<sup>(deprecated)</sup>      | number |   Yes | Yes | Creator instance key.<br>**System API**: This is a system API.|
26| agentBundle<sup>12+</sup>       | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) |   Yes | Yes | Information about the agent bundle for creating notifications.<br>**System API**: This is a system API.|
27| appInstanceKey<sup>15+</sup>       | string |   Yes | Yes | Application instance key.<br>**System API**: This is a system API.|
28| notDistributed<sup>16+</sup> | boolean | No| Yes| Whether notifications are not displayed in all scenarios across devices.<br>**NOTE**<br>This field is mutually exclusive with the **forceDistributed** field. When both fields are set, only the **notDistributed** field takes effect.<br>- **true**: Notifications are displayed only on the local device.<br>- **false** (default): Notifications are displayed on all collaboration devices.<br>**System API**: This is a system API.|
29| forceDistributed<sup>16+</sup> | boolean | No| Yes| Whether notifications are forcibly displayed in all scenario across devices.<br>**NOTE**<br>This field takes effect only when the application is on the cross-device collaborative management list and the **notDistributed** field is not set. Check whether the **collaborationFilter** field in the **notification_config.json** file contains the UID or bundle name of the application. For details about the file configuration path, see the **NOTIFICAITON_CONFIG_FILE** property in [notification_config_parse.h](https://gitee.com/openharmony/notification_distributed_notification_service/blob/master/services/ans/include/notification_config_parse.h). If yes, the application is on the cross-device collaborative management list.<br>- **true**: Notifications are displayed on all collaboration devices.<br>- **false** (default): Notifications are displayed on the applications that are on the collaborative management list.<br>**System API**: This is a system API.|
30
31## DistributedOptions<sup>8+</sup>
32
33Describes distributed notification options.
34
35**System capability**: SystemCapability.Notification.Notification
36
37| Name                  | Type           | Mandatory| Description                              |
38| ---------------------- | -------------- | ---- | ---------------------------------- |
39| remindType             | number         | No  | Notification reminder type.<br>**System API**: This is a system API. |
40
41
42## NotificationFilter<sup>11+</sup>
43
44Describes the filter criteria for querying the live view.
45
46**System capability**: SystemCapability.Notification.Notification
47
48**System API**: This is a system API.
49
50| Name           | Type                                  | Mandatory| Description                              |
51| ----------------| ------------------------------------- | ---- | ---------------------------------- |
52| bundle          | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes  | Bundle information of the live view.|
53| notificationKey | [NotificationKey](js-apis-notificationSubscribe-sys.md#notificationkey) | Yes  | Notification information, including the notification ID and label.  |
54| extraInfoKeys   | Array\<string>                        | No  | List of extra keys. If this parameter is left empty, all extra information is included.|
55
56
57## NotificationCheckRequest<sup>11+</sup>
58
59Describes the notification authentication information.
60
61**System capability**: SystemCapability.Notification.Notification
62
63**System API**: This is a system API.
64
65| Name         | Type                                                      | Mandatory| Description             |
66| --------------| --------------------------------------------------------- | ---- | ----------------- |
67| contentType   | [ContentType](js-apis-notificationManager.md#contenttype) | Yes  | Notification type.        |
68| slotType      | [SlotType](js-apis-notificationManager.md#slottype)       | Yes  | Notification slot type.        |
69| extraInfoKeys | Array\<string>                                            | Yes  | Extra information about the live view.|
70
71## UnifiedGroupInfo<sup>12+</sup>
72
73Describes the fields of notification intelligent unification information.
74
75**System capability**: SystemCapability.Notification.Notification
76
77**System API**: This is a system API.
78
79| Name                  | Type           | Mandatory| Description                              |
80| ---------------------- | -------------- | ---- | ---------------------------------- |
81| key          | string        | No  | Unified group ID.                  |
82| title  | string | No  | Unified group title.           |
83| content  | string | No  | Unified group summary.             |
84| sceneName          | string        | No  | Name of an unification scene.                  |
85| extraInfo  | {[key: string]: any} | No  | Other unification information.           |
86