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

Update docs (15800)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 98c0f060
# 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.|
# @system.notification
# @system.notification (Notification)
> **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.
......@@ -17,22 +17,22 @@ import notification from '@system.notification';
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable | Writable | Mandatory| Description |
| ----------- | ---------------------------------------------- | ---- | ------------------------- | ------------------------- | ------------------------- |
| bundleName | string | Yes | Yes | 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.|
| uri | string | Yes | Yes | No | URI of the page to be redirected to. |
| Name | Type | Mandatory| Description |
| ----------- | ---------------------------------------------- | ---- | ------------------------- |
| bundleName | string | Yes | Name of the application bundle 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 | No | URI of the page to be redirected to. |
## ShowNotificationOptions
**System capability**: SystemCapability.Notification.Notification
| Name | Type | Readable | Writable | Mandatory| Description |
| ------------- | ---------------------------------------------- | ---- | ------------------------- | ------------------------- | ------------------------- |
| contentTitle | string | Yes | Yes | No | Notification title. |
| contentText | string | Yes | Yes | No | Notification content. |
| clickAction | ActionResult | Yes | Yes | No | Action triggered when the notification is clicked. |
| Name | Type | Mandatory| Description |
| ------------- | ---------------------------------------------- | ---- | ------------------------- |
| contentTitle | string | No | Notification title. |
| contentText | string | No | Notification content. |
| clickAction | ActionResult | No | Action triggered when the notification is clicked. |
## notification.show
......@@ -59,9 +59,9 @@ export default {
clickAction: {
bundleName: 'com.example.testapp',
abilityName: 'notificationDemo',
uri: '/path/to/notification',
},
uri: '/path/to/notification'
}
});
},
}
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册