提交 7a860719 编写于 作者: E ester.zhou

Update docs (15746)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 8e40010c
# NotificationActionButton
The **NotificationActionButton** module describes the button displayed in the notification.
> **NOTE**
>
> 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.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| --------- | ----------------------------------------------- | --- | ---- | ------------------------- |
| title | string | Yes | Yes | Button title. |
| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** of the button.|
| extras | { [key: string]: any } | Yes | Yes | Extra information of the button. |
| userInput<sup>8+</sup> | [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) | Yes | Yes | User input object. |
# NotificationCommonDef
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## BundleOption
Provides the bundle information of an application.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Mandatory| Description |
| ------ | ------ |---- | ------ |
| bundle | string | Yes| Bundle information of the application.|
| uid | number | No| User ID.|
# NotificationContent
The **NotificationContent** module describes the notification content.
> **NOTE**
>
> 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.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ |
| contentType | [ContentType](./js-apis-notificationManager.md#contenttype) | Yes | Yes | Notification content type. |
| normal | [NotificationBasicContent](#notificationbasiccontent) | Yes | Yes | Normal text. |
| longText | [NotificationLongTextContent](#notificationlongtextcontent) | Yes | Yes | Long text.|
| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | Yes | Yes | Multi-line text. |
| picture | [NotificationPictureContent](#notificationpicturecontent) | Yes | Yes | Picture-attached. |
## NotificationBasicContent
Describes the normal text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | ---- | ---------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
## NotificationLongTextContent
Describes the long text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| longText | string | Yes | Yes | Long text of the notification. |
| briefText | string | Yes | Yes | Brief text of the notification.|
| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. |
## NotificationMultiLineContent
Describes the multi-line text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | --------------- | --- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| briefText | string | Yes | Yes | Brief text of the notification.|
| longTitle | string | Yes | Yes | Title of the notification in the expanded state. |
| lines | Array\<string\> | Yes | Yes | Multi-line text of the notification. |
## NotificationPictureContent
Describes the picture-attached notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | -------------- | ---- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| briefText | string | Yes | Yes | Brief text of the notification.|
| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. |
| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Picture attached to the notification. |
# NotificationFlags
The **NotificationFlags** module implements a **NotificationFlags** instance.
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ---------------- | ---------------------- | ---- | ---- | --------------------------------- |
| soundEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable the sound alert for the notification. |
| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable vibration for the notification. |
## NotificationFlagStatus
Describes the notification flag status.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Value | Description |
| -------------- | --- | --------------------------------- |
| TYPE_NONE | 0 | The default flag is used. |
| TYPE_OPEN | 1 | The notification flag is enabled. |
| TYPE_CLOSE | 2 | The notification flag is disabled. |
# NotificationRequest
The **NotificationRequest** module describes the notification request.
> **NOTE**
>
> 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.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| --------------------- | --------------------------------------------- | ---- | --- | -------------------------- |
| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | Yes | Yes | Notification content. |
| id | number | Yes | Yes | Notification ID. |
| slotType | [SlotType](js-apis-notificationManager.md#slottype) | Yes | Yes | Notification slot type. |
| isOngoing | boolean | Yes | Yes | Whether the notification is an ongoing notification. |
| isUnremovable | boolean | Yes | Yes | Whether the notification can be removed. |
| deliveryTime | number | Yes | Yes | Time when the notification is sent. |
| tapDismissed | boolean | Yes | Yes | Whether the notification is automatically cleared. |
| autoDeletedTime | number | Yes | Yes | Time when the notification is automatically cleared. |
| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected after being clicked.|
| extraInfo | {[key: string]: any} | Yes | Yes | Extended parameters. |
| color | number | Yes | Yes | Background color of the notification. Not supported currently.|
| colorEnabled | boolean | Yes | Yes | Whether the notification background color can be enabled. Not supported currently.|
| isAlertOnce | boolean | Yes | Yes | Whether the notification triggers an alert only once.|
| isStopwatch | boolean | Yes | Yes | Whether to display the stopwatch. |
| isCountDown | boolean | Yes | Yes | Whether to display the countdown time. |
| isFloatingIcon | boolean | Yes | Yes | Whether the notification is displayed as a floating icon in the status bar. |
| label | string | Yes | Yes | Notification label. |
| badgeIconStyle | number | Yes | Yes | Notification badge type. |
| showDeliveryTime | boolean | Yes | Yes | Whether to display the time when the notification is delivered. |
| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | Yes | Yes | Buttons in the notification. Up to three buttons are allowed. |
| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.|
| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Large notification icon. This field is optional, and the icon size cannot exceed 30 KB.|
| creatorBundleName | string | Yes | No | Name of the bundle that creates the notification. |
| creatorUid<sup>8+<sup> | number | Yes | No | UID used for creating the notification. |
| creatorPid | number | Yes | No | PID used for creating the notification. |
| creatorUserId| number | Yes | No | ID of the user who creates the notification. |
| hashCode | string | Yes | No | Unique ID of the notification. |
| classification | string | Yes | Yes | Notification category.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| groupName<sup>8+<sup> | string | Yes | Yes | Notification group name. |
| template<sup>8+<sup> | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | Yes | Yes | Notification template. |
| isRemoveAllowed<sup>8+<sup> | boolean | Yes | No | Whether the notification can be removed.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| source<sup>8+<sup> | number | Yes | No | Notification source.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| distributedOption<sup>8+<sup> | [DistributedOptions](#distributedoptions) | Yes | Yes | Distributed notification options. |
| deviceId<sup>8+<sup> | string | Yes | No | Device ID of the notification source.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| notificationFlags<sup>8+<sup> | [NotificationFlags](js-apis-inner-notification-notificationflags#notificationFlags) | Yes | No | Notification flags. |
| removalWantAgent<sup>9+<sup> | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected when it is removed. |
| badgeNumber<sup>9+<sup> | number | Yes | Yes | Number of notifications displayed on the application icon. |
## DistributedOptions
Describes distributed notification options.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ---------------------- | -------------- | ---- | ---- | ---------------------------------- |
| isDistributed<sup>8+<sup> | boolean | Yes | Yes | Whether the notification is a distributed notification. |
| supportDisplayDevices<sup>8+<sup> | Array\<string> | Yes | Yes | List of the devices to which the notification can be synchronized. |
| supportOperateDevices<sup>8+<sup> | Array\<string> | Yes | Yes | List of the devices on which the notification can be opened. |
| remindType<sup>8+<sup> | number | Yes | No | Notification reminder type.<br>**System API**: This is a system API and cannot be called by third-party applications. |
# NotificationSlot
The **NotificationSlot** module describes the notification slot.
> **NOTE**
>
> 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.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
| type | [SlotType](js-apis-notificationManager.md#slottype) | Yes | Yes | Notification slot type. |
| level | number | Yes | Yes | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.|
| desc | string | Yes | Yes | Notification slot description. |
| badgeFlag | boolean | Yes | Yes | Whether to display the badge. |
| bypassDnd | boolean | Yes | Yes | Whether to bypass DND mode in the system. |
| lockscreenVisibility | number | Yes | Yes | Mode for displaying the notification on the lock screen. |
| vibrationEnabled | boolean | Yes | Yes | Whether to enable vibration for the notification. |
| sound | string | Yes | Yes | Notification alert tone. |
| lightEnabled | boolean | Yes | Yes | Whether the indicator blinks for the notification. |
| lightColor | number | Yes | Yes | Indicator color of the notification. |
| vibrationValues | Array\<number\> | Yes | Yes | Vibration mode of the notification. |
| enabled<sup>9+</sup> | boolean | Yes | No | Whether the notification slot is enabled. |
# NotificationTemplate
The **NotificationTemplate** module describes the notification template.
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Notification.Notification
| Name| Type | Readable| Writable| Description |
| ---- | ---------------------- | ---- | ---- | ---------- |
| name | string | Yes | Yes | Template name.|
| data | {[key:string]: Object} | Yes | Yes | Template data.|
# NotificationUserInput
The **NotificationUserInput** module provides the notification user input.
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------- | ------ | --- | ---- | ----------------------------- |
| inputKey | string | Yes | Yes | Key to identify the user input.|
...@@ -853,8 +853,8 @@ function unsubscribeCallback(err) { ...@@ -853,8 +853,8 @@ function unsubscribeCallback(err) {
console.info("unsubscribe success"); console.info("unsubscribe success");
} }
} }
function onDisconnectCallback(data) { function onDisconnectCallback() {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("subscribe disconnect");
} }
let subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
...@@ -883,8 +883,8 @@ Unsubscribes from a notification. This API uses a promise to return the result. ...@@ -883,8 +883,8 @@ Unsubscribes from a notification. This API uses a promise to return the result.
**Example** **Example**
```js ```js
function onDisconnectCallback(data) { function onDisconnectCallback() {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("subscribe disconnect");
} }
let subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
......
...@@ -24,7 +24,7 @@ Publishes a notification. This API uses an asynchronous callback to return the r ...@@ -24,7 +24,7 @@ Publishes a notification. This API uses an asynchronous callback to return the r
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------- | ---- | ------------------------------------------- | | -------- | ------------------------------------------- | ---- | ------------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -78,7 +78,7 @@ Publishes a notification. This API uses a promise to return the result. ...@@ -78,7 +78,7 @@ Publishes a notification. This API uses a promise to return the result.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------- | ---- | ------------------------------------------- | | -------- | ------------------------------------------- | ---- | ------------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
**Error codes** **Error codes**
...@@ -130,7 +130,7 @@ Publishes a notification to a specified user. This API uses an asynchronous call ...@@ -130,7 +130,7 @@ Publishes a notification to a specified user. This API uses an asynchronous call
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------- | ---- | ------------------------------------------- | | -------- | ----------------------------------------- | ---- | ------------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
| userId | number | Yes | User ID. | | userId | number | Yes | User ID. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
...@@ -192,7 +192,7 @@ Publishes a notification to a specified user. This API uses a promise to return ...@@ -192,7 +192,7 @@ Publishes a notification to a specified user. This API uses a promise to return
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------- | ---- | ------------------------------------------- | | -------- | ----------------------------------------- | ---- | ------------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
| userId | number | Yes | User ID. | | userId | number | Yes | User ID. |
**Error codes** **Error codes**
...@@ -427,7 +427,7 @@ Adds a notification slot. This API uses an asynchronous callback to return the r ...@@ -427,7 +427,7 @@ Adds a notification slot. This API uses an asynchronous callback to return the r
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Notification slot to add.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -474,7 +474,7 @@ Adds a notification slot. This API uses a promise to return the result. ...@@ -474,7 +474,7 @@ Adds a notification slot. This API uses a promise to return the result.
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ---- | ---------------- | ---- | -------------------- | | ---- | ---------------- | ---- | -------------------- |
| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot to add.| | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Notification slot to add.|
**Error codes** **Error codes**
...@@ -585,7 +585,7 @@ Adds an array of notification slots. This API uses an asynchronous callback to r ...@@ -585,7 +585,7 @@ Adds an array of notification slots. This API uses an asynchronous callback to r
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------ | | -------- | ------------------------- | ---- | ------------------------ |
| slots | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| | slots | Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\> | Yes | Notification slots to add.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<void\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -636,7 +636,7 @@ Adds an array of notification slots. This API uses a promise to return the resul ...@@ -636,7 +636,7 @@ Adds an array of notification slots. This API uses a promise to return the resul
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----- | ------------------------- | ---- | ------------------------ | | ----- | ------------------------- | ---- | ------------------------ |
| slots | Array\<[NotificationSlot](#notificationslot)\> | Yes | Notification slots to add.| | slots | Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\> | Yes | Notification slots to add.|
**Error codes** **Error codes**
...@@ -677,7 +677,7 @@ Obtains a notification slot of a specified type. This API uses an asynchronous c ...@@ -677,7 +677,7 @@ Obtains a notification slot of a specified type. This API uses an asynchronous c
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------- | ---- | ----------------------------------------------------------- | | -------- | --------------------------------- | ---- | ----------------------------------------------------------- |
| slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.| | slotType | [SlotType](#slottype) | Yes | Type of the notification slot, which can be used for social communication, service information, content consultation, and other purposes.|
| callback | AsyncCallback\<[NotificationSlot](#notificationslot)\> | Yes | Callback used to return the result. | | callback | AsyncCallback\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\> | Yes | Callback used to return the result. |
**Error codes** **Error codes**
...@@ -757,7 +757,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ ...@@ -757,7 +757,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------- | ---- | -------------------- | | -------- | --------------------------------- | ---- | -------------------- |
| callback | AsyncCallback\<Array\<[NotificationSlot](#notificationslot)\>\> | Yes | Callback used to return all notification slots of the current application.| | callback | AsyncCallback\<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>\> | Yes | Callback used to return all notification slots of the current application.|
**Error codes** **Error codes**
...@@ -793,7 +793,7 @@ Obtains all notification slots of this application. This API uses a promise to r ...@@ -793,7 +793,7 @@ Obtains all notification slots of this application. This API uses a promise to r
| Type | Description | | Type | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<Array\<[NotificationSlot](#notificationslot)\>\> | Promise used to return all notification slots of the current application.| | Promise\<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>\> | Promise used to return all notification slots of the current application.|
**Error codes** **Error codes**
...@@ -965,7 +965,7 @@ Sets whether to enable notification for a specified application. This API uses a ...@@ -965,7 +965,7 @@ Sets whether to enable notification for a specified application. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable notification. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -1012,7 +1012,7 @@ Sets whether to enable notification for a specified application. This API uses a ...@@ -1012,7 +1012,7 @@ Sets whether to enable notification for a specified application. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable notification. |
**Error codes** **Error codes**
...@@ -1053,7 +1053,7 @@ Checks whether notification is enabled for a specified application. This API use ...@@ -1053,7 +1053,7 @@ Checks whether notification is enabled for a specified application. This API use
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ------------------------ | | -------- | --------------------- | ---- | ------------------------ |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1099,7 +1099,7 @@ Checks whether notification is enabled for a specified application. This API use ...@@ -1099,7 +1099,7 @@ Checks whether notification is enabled for a specified application. This API use
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
**Return value** **Return value**
...@@ -1187,7 +1187,7 @@ Checks whether notification is enabled for the current application. This API use ...@@ -1187,7 +1187,7 @@ Checks whether notification is enabled for the current application. This API use
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
**Return value** **Return value**
...@@ -1230,7 +1230,7 @@ Sets whether to enable the notification badge for a specified application. This ...@@ -1230,7 +1230,7 @@ Sets whether to enable the notification badge for a specified application. This
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable notification. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -1277,7 +1277,7 @@ Sets whether to enable the notification badge for a specified application. This ...@@ -1277,7 +1277,7 @@ Sets whether to enable the notification badge for a specified application. This
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable notification. |
**Error codes** **Error codes**
...@@ -1318,7 +1318,7 @@ Checks whether the notification badge is enabled for a specified application. Th ...@@ -1318,7 +1318,7 @@ Checks whether the notification badge is enabled for a specified application. Th
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ------------------------ | | -------- | --------------------- | ---- | ------------------------ |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1364,7 +1364,7 @@ Checks whether the notification badge is enabled for a specified application. Th ...@@ -1364,7 +1364,7 @@ Checks whether the notification badge is enabled for a specified application. Th
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
**Return value** **Return value**
...@@ -1483,8 +1483,8 @@ Sets the notification slot for a specified application. This API uses an asynchr ...@@ -1483,8 +1483,8 @@ Sets the notification slot for a specified application. This API uses an asynchr
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot. | | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Notification slot. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1533,8 +1533,8 @@ Sets the notification slot for a specified application. This API uses a promise ...@@ -1533,8 +1533,8 @@ Sets the notification slot for a specified application. This API uses a promise
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
| slot | [NotificationSlot](#notificationslot) | Yes | Notification slot.| | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Notification slot.|
**Error codes** **Error codes**
...@@ -1577,8 +1577,8 @@ Obtains the notification slots of a specified application. This API uses an asyn ...@@ -1577,8 +1577,8 @@ Obtains the notification slots of a specified application. This API uses an asyn
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------- | ---- | -------------------- | | -------- | ---------------------------------------- | ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| callback | AsyncCallback<Array\<[NotificationSlot](#notificationslot)\>> | Yes | Callback used to return the result.| | callback | AsyncCallback<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1623,13 +1623,13 @@ Obtains the notification slots of a specified application. This API uses a promi ...@@ -1623,13 +1623,13 @@ Obtains the notification slots of a specified application. This API uses a promi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise<Array\<[NotificationSlot](#notificationslot)\>> | Promise used to return the result.| | Promise<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>> | Promise used to return the result.|
**Error codes** **Error codes**
...@@ -1669,7 +1669,7 @@ Obtains the number of notification slots of a specified application. This API us ...@@ -1669,7 +1669,7 @@ Obtains the number of notification slots of a specified application. This API us
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------------- | | -------- | ------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. |
| callback | AsyncCallback\<number\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<number\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1715,7 +1715,7 @@ Obtains the number of notification slots of a specified application. This API us ...@@ -1715,7 +1715,7 @@ Obtains the number of notification slots of a specified application. This API us
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle of the application.| | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.|
**Return value** **Return value**
...@@ -1762,7 +1762,7 @@ Obtains all active notifications. This API uses an asynchronous callback to retu ...@@ -1762,7 +1762,7 @@ Obtains all active notifications. This API uses an asynchronous callback to retu
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------- | | -------- | ------------------------------------------------------------ | ---- | -------------------- |
| callback | AsyncCallback<Array\<[NotificationRequest](#notificationrequest)\>> | Yes | Callback used to return the result.| | callback | AsyncCallback<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1788,7 +1788,7 @@ notificationManager.getAllActiveNotifications(getAllActiveNotificationsCallback) ...@@ -1788,7 +1788,7 @@ notificationManager.getAllActiveNotifications(getAllActiveNotificationsCallback)
## notificationManager.getAllActiveNotifications ## notificationManager.getAllActiveNotifications
getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> getAllActiveNotifications(): Promise\<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>\>
Obtains all active notifications. This API uses a promise to return the result. Obtains all active notifications. This API uses a promise to return the result.
...@@ -1802,7 +1802,7 @@ Obtains all active notifications. This API uses a promise to return the result. ...@@ -1802,7 +1802,7 @@ Obtains all active notifications. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> | Promise used to return the result.| | Promise\<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>\> | Promise used to return the result.|
**Error codes** **Error codes**
...@@ -1904,7 +1904,7 @@ Obtains active notifications of this application. This API uses an asynchronous ...@@ -1904,7 +1904,7 @@ Obtains active notifications of this application. This API uses an asynchronous
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------ |
| callback | AsyncCallback<Array\<[NotificationRequest](#notificationrequest)\>> | Yes | Callback used to return the result.| | callback | AsyncCallback<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -1932,7 +1932,7 @@ notificationManager.getActiveNotifications(getActiveNotificationsCallback); ...@@ -1932,7 +1932,7 @@ notificationManager.getActiveNotifications(getActiveNotificationsCallback);
## notificationManager.getActiveNotifications ## notificationManager.getActiveNotifications
getActiveNotifications(): Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> getActiveNotifications(): Promise\<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>\>
Obtains active notifications of this application. This API uses a promise to return the result. Obtains active notifications of this application. This API uses a promise to return the result.
...@@ -1942,7 +1942,7 @@ Obtains active notifications of this application. This API uses a promise to ret ...@@ -1942,7 +1942,7 @@ Obtains active notifications of this application. This API uses a promise to ret
| Type | Description | | Type | Description |
| ------------------------------------------------------------ | --------------------------------------- | | ------------------------------------------------------------ | --------------------------------------- |
| Promise\<Array\<[NotificationRequest](#notificationrequest)\>\> | Promise used to return the result.| | Promise\<Array\<[NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest)\>\> | Promise used to return the result.|
**Error codes** **Error codes**
...@@ -1974,7 +1974,7 @@ Cancels notifications under a notification group of this application. This API u ...@@ -1974,7 +1974,7 @@ Cancels notifications under a notification group of this application. This API u
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------- | | --------- | --------------------- | ---- | ---------------------------- |
| groupName | string | Yes | Name of the notification group, which is specified through [NotificationRequest](#notificationrequest) when the notification is published.| | groupName | string | Yes | Name of the notification group, which is specified through [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) when the notification is published.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -2052,7 +2052,7 @@ Removes notifications under a notification group of a specified application. Thi ...@@ -2052,7 +2052,7 @@ Removes notifications under a notification group of a specified application. Thi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------- | | --------- | --------------------- | ---- | ---------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| groupName | string | Yes | Name of the notification group. | | groupName | string | Yes | Name of the notification group. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -2100,7 +2100,7 @@ Removes notifications under a notification group of a specified application. Thi ...@@ -2100,7 +2100,7 @@ Removes notifications under a notification group of a specified application. Thi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------- | ------------ | ---- | -------------- | | --------- | ------------ | ---- | -------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| groupName | string | Yes | Name of the notification group.| | groupName | string | Yes | Name of the notification group.|
**Error codes** **Error codes**
...@@ -2743,7 +2743,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ ...@@ -2743,7 +2743,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/
**Example** **Example**
```javascript ```javascript
function setDistributedEnableCallback() { function setDistributedEnableCallback(err) {
if (err) { if (err) {
console.error(`setDistributedEnable failed, code is ${err.code}, message is ${err.message}`); console.error(`setDistributedEnable failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
...@@ -2888,7 +2888,7 @@ Sets whether a specified application supports distributed notifications. This AP ...@@ -2888,7 +2888,7 @@ Sets whether a specified application supports distributed notifications. This AP
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| enable | boolean | Yes | Whether the device supports distributed notifications. | | enable | boolean | Yes | Whether the device supports distributed notifications. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -2942,7 +2942,7 @@ Sets whether a specified application supports distributed notifications. This AP ...@@ -2942,7 +2942,7 @@ Sets whether a specified application supports distributed notifications. This AP
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| enable | boolean | Yes | Whether the device supports distributed notifications. | | enable | boolean | Yes | Whether the device supports distributed notifications. |
**Error codes** **Error codes**
...@@ -2987,7 +2987,7 @@ Checks whether a specified application supports distributed notifications. This ...@@ -2987,7 +2987,7 @@ Checks whether a specified application supports distributed notifications. This
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -3005,7 +3005,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ ...@@ -3005,7 +3005,7 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/
**Example** **Example**
```javascript ```javascript
function isDistributedEnabledByBundleCallback(data) { function isDistributedEnabledByBundleCallback(err, data) {
if (err) { if (err) {
console.error(`isDistributedEnabledByBundle failed, code is ${err.code}, message is ${err.message}`); console.error(`isDistributedEnabledByBundle failed, code is ${err.code}, message is ${err.message}`);
} else { } else {
...@@ -3036,7 +3036,7 @@ Checks whether a specified application supports distributed notifications. This ...@@ -3036,7 +3036,7 @@ Checks whether a specified application supports distributed notifications. This
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
**Return value** **Return value**
...@@ -3164,7 +3164,7 @@ Publishes a notification through the reminder agent. This API uses an asynchrono ...@@ -3164,7 +3164,7 @@ Publishes a notification through the reminder agent. This API uses an asynchrono
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------------- | ------------------------------------------- | ---- | ---------------------------------------- | | -------------------- | ------------------------------------------- | ---- | ---------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. | | representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. |
| userId | number | Yes | User ID. | | userId | number | Yes | User ID. |
| callback | AsyncCallback | Yes | Callback used to return the result. | | callback | AsyncCallback | Yes | Callback used to return the result. |
...@@ -3231,7 +3231,7 @@ Publishes a notification through the reminder agent. This API uses a promise to ...@@ -3231,7 +3231,7 @@ Publishes a notification through the reminder agent. This API uses a promise to
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------------------- | ------------------------------------------- | ---- | --------------------------------------------- | | -------------------- | ------------------------------------------- | ---- | --------------------------------------------- |
| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| | request | [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) | Yes | Content and related configuration of the notification to publish.|
| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. | | representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. |
| userId | number | Yes | User ID. | | userId | number | Yes | User ID. |
...@@ -3391,9 +3391,9 @@ Sets whether to enable a specified notification slot type for a specified applic ...@@ -3391,9 +3391,9 @@ Sets whether to enable a specified notification slot type for a specified applic
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ---------------------- | | -------- | ----------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| type | [SlotType](#slottype) | Yes | Notification slot type. | | type | [SlotType](#slottype) | Yes | Notification slot type. |
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable the notification slot type. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -3442,7 +3442,7 @@ Sets whether to enable a specified notification slot type for a specified applic ...@@ -3442,7 +3442,7 @@ Sets whether to enable a specified notification slot type for a specified applic
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | -------------- | | ------ | ----------------------------- | ---- | -------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| type | [SlotType](#slottype) | Yes | Notification slot type.| | type | [SlotType](#slottype) | Yes | Notification slot type.|
| enable | boolean | Yes | Whether to enable notification. | | enable | boolean | Yes | Whether to enable notification. |
...@@ -3485,7 +3485,7 @@ Checks whether a specified notification slot type is enabled for a specified app ...@@ -3485,7 +3485,7 @@ Checks whether a specified notification slot type is enabled for a specified app
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ---------------------- | | -------- | ----------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| type | [SlotType](#slottype) | Yes | Notification slot type. | | type | [SlotType](#slottype) | Yes | Notification slot type. |
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.|
...@@ -3534,7 +3534,7 @@ Checks whether a specified notification slot type is enabled for a specified app ...@@ -3534,7 +3534,7 @@ Checks whether a specified notification slot type is enabled for a specified app
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | -------------- | | ------ | ----------------------------- | ---- | -------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| type | [SlotType](#slottype) | Yes | Notification slot type.| | type | [SlotType](#slottype) | Yes | Notification slot type.|
**Return value** **Return value**
...@@ -3809,16 +3809,6 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) => ...@@ -3809,16 +3809,6 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) =>
| LEVEL_HIGH | 4 | Notification is enabled, and the notification icon is displayed in the status bar, with an alert tone and banner.| | LEVEL_HIGH | 4 | Notification is enabled, and the notification icon is displayed in the status bar, with an alert tone and banner.|
## BundleOption
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ------ | ------ |---- | --- | ------ |
| bundle | string | Yes | Yes | Bundle information of the application.|
| uid | number | Yes | Yes | User ID.|
## SlotType ## SlotType
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
...@@ -3832,227 +3822,6 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) => ...@@ -3832,227 +3822,6 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) =>
| OTHER_TYPES | 0xFFFF | Notification slot for other purposes.| | OTHER_TYPES | 0xFFFF | Notification slot for other purposes.|
## NotificationActionButton
Describes the button displayed in the notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| --------- | ----------------------------------------------- | --- | ---- | ------------------------- |
| title | string | Yes | Yes | Button title. |
| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** of the button.|
| extras | { [key: string]: any } | Yes | Yes | Extra information of the button. |
| userInput | [NotificationUserInput](#notificationuserinput) | Yes | Yes | User input object. |
## NotificationBasicContent
Describes the normal text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | ---- | ---------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
## NotificationLongTextContent
Describes the long text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| longText | string | Yes | Yes | Long text of the notification. |
| briefText | string | Yes | Yes | Brief text of the notification.|
| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. |
## NotificationMultiLineContent
Describes the multi-line text notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | --------------- | --- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| briefText | string | Yes | Yes | Brief text of the notification.|
| longTitle | string | Yes | Yes | Title of the notification in the expanded state. |
| lines | Array\<string\> | Yes | Yes | Multi-line text of the notification. |
## NotificationPictureContent
Describe the picture-attached notification.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------- | -------------- | ---- | --- | -------------------------------- |
| title | string | Yes | Yes | Notification title. |
| text | string | Yes | Yes | Notification content. |
| additionalText | string | Yes | Yes | Additional information of the notification.|
| briefText | string | Yes | Yes | Brief text of the notification.|
| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. |
| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Picture attached to the notification. |
## NotificationContent
Describes the notification content.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ |
| contentType | [ContentType](#contenttype) | Yes | Yes | Notification content type. |
| normal | [NotificationBasicContent](#notificationbasiccontent) | Yes | Yes | Normal text. |
| longText | [NotificationLongTextContent](#notificationlongtextcontent) | Yes | Yes | Long text.|
| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | Yes | Yes | Multi-line text. |
| picture | [NotificationPictureContent](#notificationpicturecontent) | Yes | Yes | Picture-attached. |
## NotificationFlagStatus
Describes the notification flag status.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Value | Description |
| -------------- | --- | --------------------------------- |
| TYPE_NONE | 0 | The default flag is used. |
| TYPE_OPEN | 1 | The notification flag is enabled. |
| TYPE_CLOSE | 2 | The notification flag is disabled. |
## NotificationFlags
Enumerates notification flags.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ---------------- | ---------------------- | ---- | ---- | --------------------------------- |
| soundEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable the sound alert for the notification. |
| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable vibration for the notification. |
## NotificationRequest
Describes the notification request.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| --------------------- | --------------------------------------------- | ---- | --- | -------------------------- |
| content | [NotificationContent](#notificationcontent) | Yes | Yes | Notification content. |
| id | number | Yes | Yes | Notification ID. |
| slotType | [SlotType](#slottype) | Yes | Yes | Notification slot type. |
| isOngoing | boolean | Yes | Yes | Whether the notification is an ongoing notification. |
| isUnremovable | boolean | Yes | Yes | Whether the notification can be removed. |
| deliveryTime | number | Yes | Yes | Time when the notification is sent. |
| tapDismissed | boolean | Yes | Yes | Whether the notification is automatically cleared. |
| autoDeletedTime | number | Yes | Yes | Time when the notification is automatically cleared. |
| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected after being clicked.|
| extraInfo | {[key: string]: any} | Yes | Yes | Extended parameters. |
| color | number | Yes | Yes | Background color of the notification. Not supported currently.|
| colorEnabled | boolean | Yes | Yes | Whether the notification background color can be enabled. Not supported currently.|
| isAlertOnce | boolean | Yes | Yes | Whether the notification triggers an alert only once.|
| isStopwatch | boolean | Yes | Yes | Whether to display the stopwatch. |
| isCountDown | boolean | Yes | Yes | Whether to display the countdown time. |
| isFloatingIcon | boolean | Yes | Yes | Whether the notification is displayed as a floating icon in the status bar. |
| label | string | Yes | Yes | Notification label. |
| badgeIconStyle | number | Yes | Yes | Notification badge type. |
| showDeliveryTime | boolean | Yes | Yes | Whether to display the time when the notification is delivered. |
| actionButtons | Array\<[NotificationActionButton](#notificationactionbutton)\> | Yes | Yes | Buttons in the notification. Up to three buttons are allowed. |
| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.|
| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Large notification icon. This field is optional, and the icon size cannot exceed 30 KB.|
| creatorBundleName | string | Yes | No | Name of the bundle that creates the notification. |
| creatorUid | number | Yes | No | UID used for creating the notification. |
| creatorPid | number | Yes | No | PID used for creating the notification. |
| creatorUserId| number | Yes | No | ID of the user who creates the notification. |
| hashCode | string | Yes | No | Unique ID of the notification. |
| classification | string | Yes | Yes | Notification category.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| groupName| string | Yes | Yes | Notification group name. |
| template | [NotificationTemplate](#notificationtemplate) | Yes | Yes | Notification template. |
| isRemoveAllowed | boolean | Yes | No | Whether the notification can be removed.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| source | number | Yes | No | Notification source.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| distributedOption | [DistributedOptions](#distributedoptions) | Yes | Yes | Distributed notification options. |
| deviceId | string | Yes | No | Device ID of the notification source.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| notificationFlags | [NotificationFlags](#notificationflags) | Yes | No | Notification flags. |
| removalWantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected when it is removed. |
| badgeNumber | number | Yes | Yes | Number of notifications displayed on the application icon. |
## DistributedOptions
Describes distributed options.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ---------------------- | -------------- | ---- | ---- | ---------------------------------- |
| isDistributed | boolean | Yes | Yes | Whether the notification is a distributed notification. |
| supportDisplayDevices | Array\<string> | Yes | Yes | List of the devices to which the notification can be synchronized. |
| supportOperateDevices | Array\<string> | Yes | Yes | List of the devices on which the notification can be opened. |
| remindType | number | Yes | No | Notification reminder type.<br>**System API**: This is a system API and cannot be called by third-party applications. |
## NotificationSlot
Describes the notification slot.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------------------- | --------------------- | ---- | --- | ------------------------------------------ |
| type | [SlotType](#slottype) | Yes | Yes | Notification slot type. |
| level | number | Yes | Yes | Notification level. If this parameter is not set, the default value is used based on the notification slot type.|
| desc | string | Yes | Yes | Notification slot description. |
| badgeFlag | boolean | Yes | Yes | Whether to display the badge. |
| bypassDnd | boolean | Yes | Yes | Whether to bypass DND mode in the system. |
| lockscreenVisibility | number | Yes | Yes | Mode for displaying the notification on the lock screen. |
| vibrationEnabled | boolean | Yes | Yes | Whether vibration is enabled for the notification. |
| sound | string | Yes | Yes | Notification alert tone. |
| lightEnabled | boolean | Yes | Yes | Whether the indicator blinks for the notification. |
| lightColor | number | Yes | Yes | Indicator color of the notification. |
| vibrationValues | Array\<number\> | Yes | Yes | Vibration mode of the notification. |
| enabled<sup>9+</sup> | boolean | Yes | No | Whether the notification slot is enabled. |
## NotificationTemplate
Describes the notification template.
**System capability**: SystemCapability.Notification.Notification
| Name| Type | Readable| Writable| Description |
| ---- | ---------------------- | ---- | ---- | ---------- |
| name | string | Yes | Yes | Template name.|
| data | {[key:string]: Object} | Yes | Yes | Template data.|
## NotificationUserInput
Provides the notification user input.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------- | ------ | --- | ---- | ----------------------------- |
| inputKey | string | Yes | Yes | Key to identify the user input.|
## DeviceRemindType ## DeviceRemindType
......
...@@ -30,8 +30,8 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -30,8 +30,8 @@ Subscribes to a notification with the subscription information specified. This A
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ---------------- | | ---------- | ------------------------- | ---- | ---------------- |
| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | | subscriber | [NotificationSubscriber](js-apis-notification.md#notificationsubscriber) | Yes | Notification subscriber. |
| info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | Yes | Notification subscription information.| | info | [NotificationSubscribeInfo](js-apis-notification.md#notificationsubscribeinfo) | Yes | Notification subscription information.|
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -83,7 +83,7 @@ Subscribes to notifications of all applications under this user. This API uses a ...@@ -83,7 +83,7 @@ Subscribes to notifications of all applications under this user. This API uses a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | ---------------- | | ---------- | ---------------------- | ---- | ---------------- |
| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | | subscriber | [NotificationSubscriber](js-apis-notification.md#notificationsubscriber) | Yes | Notification subscriber. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -133,8 +133,8 @@ Subscribes to a notification with the subscription information specified. This A ...@@ -133,8 +133,8 @@ Subscribes to a notification with the subscription information specified. This A
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------ | | ---------- | ------------------------- | ---- | ------------ |
| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| | subscriber | [NotificationSubscriber](js-apis-notification.md#notificationsubscriber) | Yes | Notification subscriber.|
| info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | No | Notification subscription information. | | info | [NotificationSubscribeInfo](js-apis-notification.md#notificationsubscribeinfo) | No | Notification subscription information. |
**Error codes** **Error codes**
...@@ -178,7 +178,7 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu ...@@ -178,7 +178,7 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | -------------------- | | ---------- | ---------------------- | ---- | -------------------- |
| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | | subscriber | [NotificationSubscriber](js-apis-notification.md#notificationsubscriber) | Yes | Notification subscriber. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -201,8 +201,8 @@ function unsubscribeCallback(err) { ...@@ -201,8 +201,8 @@ function unsubscribeCallback(err) {
console.info("unsubscribe success"); console.info("unsubscribe success");
} }
} }
function onDisconnectCallback(data) { function onDisconnectCallback() {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("subscribe disconnect");
} }
let subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
...@@ -226,7 +226,7 @@ Unsubscribes from a notification. This API uses a promise to return the result. ...@@ -226,7 +226,7 @@ Unsubscribes from a notification. This API uses a promise to return the result.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | ------------ | | ---------- | ---------------------- | ---- | ------------ |
| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| | subscriber | [NotificationSubscriber](js-apis-notification.md#notificationsubscriber) | Yes | Notification subscriber.|
**Error codes** **Error codes**
...@@ -241,8 +241,8 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ ...@@ -241,8 +241,8 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/
**Example** **Example**
```js ```js
function onDisconnectCallback(data) { function onDisconnectCallback() {
console.info("Cancel callback: " + JSON.stringify(data)); console.info("subscribe disconnect");
} }
let subscriber = { let subscriber = {
onDisconnect: onDisconnectCallback onDisconnect: onDisconnectCallback
...@@ -268,8 +268,8 @@ Removes a notification for a specified application. This API uses an asynchronou ...@@ -268,8 +268,8 @@ Removes a notification for a specified application. This API uses an asynchronou
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | ----------------------------------| ---- | -------------------- | | --------------- | ----------------------------------| ---- | -------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. |
| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | | notificationKey | [NotificationKey](js-apis-notification.md#notificationkey) | Yes | Notification key. |
| reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -324,8 +324,8 @@ Removes a notification for a specified application. This API uses a promise to r ...@@ -324,8 +324,8 @@ Removes a notification for a specified application. This API uses a promise to r
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| --------------- | --------------- | ---- | ---------- | | --------------- | --------------- | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| | bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application.|
| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | | notificationKey | [NotificationKey]((js-apis-notification.md#notificationkey)) | Yes | Notification key. |
| reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. |
**Error codes** **Error codes**
...@@ -372,7 +372,7 @@ Removes a specified notification. This API uses an asynchronous callback to retu ...@@ -372,7 +372,7 @@ Removes a specified notification. This API uses an asynchronous callback to retu
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| hashCode | string | Yes | Unique notification ID. It is the **hashCode** in the [NotificationRequest](#notificationrequest) object of [SubscribeCallbackData](#subscribecallbackdata) of the [onConsume](#onconsume) callback.| | hashCode | string | Yes | Unique notification ID. It is the value of **hashCode** in the [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) object of [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) in the [onConsume](#onconsume) callback. |
| reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
...@@ -459,7 +459,7 @@ Removes all notifications for a specified application. This API uses an asynchro ...@@ -459,7 +459,7 @@ Removes all notifications for a specified application. This API uses an asynchro
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ---------------------------- | | -------- | --------------------- | ---- | ---------------------------- |
| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | | bundle | [BundleOption]((js-apis-inner-notification-notificationCommonDef.md#bundleoption)) | Yes | Bundle information of the application. |
| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| | callback | AsyncCallback\<void\> | Yes | Callback used to return the result.|
**Error codes** **Error codes**
...@@ -547,7 +547,7 @@ Removes all notifications for a specified application. This API uses a promise t ...@@ -547,7 +547,7 @@ Removes all notifications for a specified application. This API uses a promise t
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](#bundleoption) | No | Bundle information of the application.| | bundle | [BundleOption]((js-apis-inner-notification-notificationCommonDef.md#bundleoption)) | No | Bundle information of the application.|
**Error codes** **Error codes**
...@@ -668,7 +668,7 @@ Provides callbacks for receiving or removing notifications and serves as the inp ...@@ -668,7 +668,7 @@ Provides callbacks for receiving or removing notifications and serves as the inp
### onConsume ### onConsume
onConsume?: (data: [SubscribeCallbackData](#subscribecallbackdata)) => void onConsume?: (data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void
Callback for receiving notifications. Callback for receiving notifications.
...@@ -680,7 +680,7 @@ Callback for receiving notifications. ...@@ -680,7 +680,7 @@ Callback for receiving notifications.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ------------ | ------------------------ | ---- | -------------------------- | | ------------ | ------------------------ | ---- | -------------------------- |
| data | [SubscribeCallbackData](#subscribecallbackdata) | Yes| Information about the notification received.| | data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification received.|
**Example** **Example**
...@@ -708,7 +708,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); ...@@ -708,7 +708,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback);
### onCancel ### onCancel
onCancel?:(data: [SubscribeCallbackData](#subscribecallbackdata)) => void onCancel?:(data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void
Callback for canceling notifications. Callback for canceling notifications.
...@@ -720,7 +720,7 @@ Callback for canceling notifications. ...@@ -720,7 +720,7 @@ Callback for canceling notifications.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ------------ | ------------------------ | ---- | -------------------------- | | ------------ | ------------------------ | ---- | -------------------------- |
| data | [SubscribeCallbackData](#subscribecallbackdata) | Yes| Information about the notification to cancel.| | data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification to cancel.|
**Example** **Example**
...@@ -748,7 +748,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); ...@@ -748,7 +748,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback);
### onUpdate ### onUpdate
onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) => void onUpdate?:(data: [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) => void
Callback for notification sorting updates. Callback for notification sorting updates.
...@@ -760,7 +760,7 @@ Callback for notification sorting updates. ...@@ -760,7 +760,7 @@ Callback for notification sorting updates.
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ------------ | ------------------------ | ---- | -------------------------- | | ------------ | ------------------------ | ---- | -------------------------- |
| data | [NotificationSortingMap](#notificationsortingmap) | Yes| Latest notification sorting list.| | data | [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) | Yes| Latest notification sorting list.|
**Example** **Example**
...@@ -935,7 +935,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); ...@@ -935,7 +935,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback);
### onEnabledNotificationChanged ### onEnabledNotificationChanged
onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](#enablednotificationcallbackdata)) => void onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)) => void
Listens for the notification enabled status changes. This API uses an asynchronous callback to return the result. Listens for the notification enabled status changes. This API uses an asynchronous callback to return the result.
...@@ -947,7 +947,7 @@ Listens for the notification enabled status changes. This API uses an asynchrono ...@@ -947,7 +947,7 @@ Listens for the notification enabled status changes. This API uses an asynchrono
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| ------------ | ------------------------ | ---- | -------------------------- | | ------------ | ------------------------ | ---- | -------------------------- |
| callback | AsyncCallback\<[EnabledNotificationCallbackData](#enablednotificationcallbackdata)\> | Yes| Callback used to return the result.| | callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)\> | Yes| Callback used to return the result.|
**Example** **Example**
...@@ -1013,104 +1013,6 @@ let subscriber = { ...@@ -1013,104 +1013,6 @@ let subscriber = {
notificationSubscribe.subscribe(subscriber, subscribeCallback); notificationSubscribe.subscribe(subscriber, subscribeCallback);
``` ```
## BundleOption
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ------ | ------ |---- | --- | ------ |
| bundle | string | Yes | Yes | Bundle information of the application.|
| uid | number | Yes | Yes | User ID.|
## NotificationKey
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| ----- | ------ | ---- | --- | -------- |
| id | number | Yes | Yes | Notification ID. |
| label | string | Yes | Yes | Notification label.|
## SubscribeCallbackData
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable | Writable | Description |
| --------------- | ------------------------------------------------- | -------- | -------- | -------- |
| request | [NotificationRequest](js-apis-notificationManager.md#notificationrequest) | Yes| No| Notification content.|
| sortingMap | [NotificationSortingMap](#notificationsortingmap) | Yes| No| Notification sorting information.|
| reason | number | Yes | No | Reason for deletion.|
| sound | string | Yes | No | Sound used for notification.|
| vibrationValues | Array\<number\> | Yes | No | Vibration used for notification.|
## EnabledNotificationCallbackData
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable | Writable | Description |
| ------ | ------- | ---------------- | ---------------- | ---------------- |
| bundle | string | Yes| No| Bundle name of the application. |
| uid | number | Yes| No| UID of the application. |
| enable | boolean | Yes| No| Notification enabled status of the application.|
## NotificationSorting
Provides sorting information of active notifications.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| -------- | ------------------------------------- | ---- | --- | ------------ |
| slot | [NotificationSlot](js-apis-notificationManager.md#notificationslot) | Yes | No | Notification slot.|
| hashCode | string | Yes | No | Unique ID of the notification.|
| ranking | number | Yes | No | Notification sequence number.|
## NotificationSortingMap
Provides sorting information of active notifications in all subscribed notifications.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| -------------- | ------------------------------------------------------------ | ---- | --- | ---------------- |
| sortings | {[key: string]: [NotificationSorting](#notificationsorting)} | Yes | No | Array of notification sorting information.|
| sortedHashCode | Array\<string\> | Yes | No | Array of unique notification IDs.|
## NotificationSubscribeInfo
Provides the information about the publisher for notification subscription.
**System capability**: SystemCapability.Notification.Notification
**System API**: This is a system API and cannot be called by third-party applications.
| Name | Type | Readable| Writable| Description |
| ----------- | --------------- | --- | ---- | ------------------------------- |
| bundleNames | Array\<string\> | Yes | Yes | Bundle names of the applications whose notifications are to be subscribed to.|
| userId | number | Yes | Yes | User whose notifications are to be subscribed to. |
## NotificationUserInput
Provides the notification user input.
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable| Writable| Description |
| -------- | ------ | --- | ---- | ----------------------------- |
| inputKey | string | Yes | Yes | Key to identify the user input.|
## RemoveReason ## RemoveReason
......
# @system.notification (Notification) # @system.notification (Notification)
> **NOTE** > **NOTE**
> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.notification`](js-apis-notification.md). > - The APIs of this module are no longer maintained since API version 7. You are advised to use [@ohos.notification](js-apis-notification.md).
> >
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...@@ -17,22 +17,22 @@ import notification from '@system.notification'; ...@@ -17,22 +17,22 @@ import notification from '@system.notification';
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable | Writable | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ---------------------------------------------- | ---- | ------------------------- | ------------------------- | ------------------------- | | ----------- | ---------------------------------------------- | ---- | ------------------------- |
| bundleName | string | Yes | Yes | Yes | Name of the application bundle to which the notification will be redirected after being clicked. | | bundleName | string | Yes | Name of the application bundle to which the notification will be redirected after being clicked. |
| abilityName | string | Yes | Yes | Yes | Name of the application ability to which the notification will be redirected after being clicked.| | abilityName | string | Yes | Name of the application ability to which the notification will be redirected after being clicked.|
| uri | string | Yes | Yes | No | URI of the page to be redirected to. | | uri | string | No | URI of the page to be redirected to. |
## ShowNotificationOptions ## ShowNotificationOptions
**System capability**: SystemCapability.Notification.Notification **System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable | Writable | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------------- | ---------------------------------------------- | ---- | ------------------------- | ------------------------- | ------------------------- | | ------------- | ---------------------------------------------- | ---- | ------------------------- |
| contentTitle | string | Yes | Yes | No | Notification title. | | contentTitle | string | No | Notification title. |
| contentText | string | Yes | Yes | No | Notification content. | | contentText | string | No | Notification content. |
| clickAction | ActionResult | Yes | Yes | No | Action triggered when the notification is clicked. | | clickAction | ActionResult | No | Action triggered when the notification is clicked. |
## notification.show ## notification.show
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册