diff --git a/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md b/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md index f1c7c82e6af9bdeacc971596d47b217c72f1ddc9..3d95fcdc72e9b8638b84b833048042c4a90ddc9a 100644 --- a/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md +++ b/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md @@ -9,6 +9,12 @@ You can use the APIs of this module to start StaticSubscriberExtensionAbilities. > The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The APIs of this module can be used only in the stage model. +## Modules to Import + +```ts +import StaticSubscriberExtensionContext from '@ohos.application.StaticSubscriberExtensionContext' +``` + ## Usage Before using the **StaticSubscriberExtensionContext** module, you must first obtain a **StaticSubscriberExtensionAbility** instance. @@ -31,6 +37,8 @@ Observe the following when using this API: - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. +**Required permissions**: ohos.permission.START_ABILITIES_FROM_BACKGROUND + **System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API and cannot be called by third-party applications. @@ -98,6 +106,8 @@ Observe the following when using this API: - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. +**Required permissions**: ohos.permission.START_ABILITIES_FROM_BACKGROUND + **System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API and cannot be called by third-party applications. diff --git a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md index c28c4372ba1cf10ad9c67669913de1b4ac06ae17..7fa76fa6c4c779bb1ba7e6584cbae56bc4e6d501 100644 --- a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md +++ b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @@ -4,7 +4,7 @@ The **StaticSubscriberExtensionAbility** module provides Extension abilities for > **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. +> 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. > > The APIs of this module can be used only in the stage model. ## Modules to Import @@ -15,11 +15,13 @@ import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriber ## Attributes -**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**System API**: This is a system API and cannot be called by third-party applications. | Name | Type | Readable| Writable| Description | | ------- | ------------------------------------------------------------ | ---- | ---- | -------- | -| context | [StaticSubscriberExtensionContext](js-apis-application-StaticSubscriberExtensionContext.md) | Yes | No | Context.| +| context10+ | [StaticSubscriberExtensionContext](js-apis-application-StaticSubscriberExtensionContext.md) | Yes | No | Context.| ## StaticSubscriberExtensionAbility.onReceiveEvent diff --git a/en/application-dev/reference/apis/js-apis-emitter.md b/en/application-dev/reference/apis/js-apis-emitter.md index 9c5499f62e4abf1bbeb14d53f823adc356103641..2af040bfe309259ab23905248aaed8c7f4ce6d43 100644 --- a/en/application-dev/reference/apis/js-apis-emitter.md +++ b/en/application-dev/reference/apis/js-apis-emitter.md @@ -93,9 +93,36 @@ Unsubscribes from an event. **Example** ```javascript +// Unregister the callbacks of all events whose eventID is 1. emitter.off(1); ``` +## emitter.off10+ + +off(eventId: number, callback: Callback\<[EventData](#eventdata)\>): void + +Unsubscribes from an event. If the specified callback has been registered through the **on** or **once** API, it is unregistered. Otherwise, no processing is performed. + +**System capability**: SystemCapability.Notification.Emitter + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------- | ------ | ---- | ------ | +| eventId | number | Yes | Event ID.| +| callback10+ | Callback\<[EventData](#eventdata)\> | Yes | Callback to unregister. | + +**Example** + +```javascript +// Unregister the emitterCallback callback for the event whose eventID is 1. +// If the callback has not been registered, no processing is performed. +function emitterCallback() { + console.info('callback'); +} +emitter.off(1, emitterCallback); +``` + ## emitter.emit emit(event: [InnerEvent](#innerevent), data?: [EventData](#eventdata)): void diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md index a8afc035794c4e35fbdf9d68a715fe2bb67e7b36..6509069fb5a5e4a73e056cf77df6812a2a540613 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md @@ -1,9 +1,12 @@ # CommonEventData +The **CommonEventData** module provides APIs for defining common event data. + > **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. +## Attributes **System capability**: SystemCapability.Notification.CommonEvent diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md index 332fd934c7ee9799d4356acc45996d3632b4f9d2..44b9c6f14060a9c3b8bf9f340713724ff61cd40e 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md @@ -1,9 +1,13 @@ # CommonEventPublishData +The **CommonEventPublishData** module provides APIs for defining common event content and attributes. + > **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. +## Attributes + **System capability**: SystemCapability.Notification.CommonEvent | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md index 48c1cbf8ba92a32af0f45917ca9f03708ae6e30c..acffbaae438abec964ab798271c3b7e2cbda24c7 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md @@ -4,6 +4,8 @@ > > 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. +## Attributes + **System capability**: SystemCapability.Notification.CommonEvent | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md index ee7f0e37c7d85cdfdde76ae9b852bb05964af358..f87ae0741056daba0f73b411c102b3017c312a62 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md @@ -1,11 +1,13 @@ # NotificationActionButton -The **NotificationActionButton** module describes the button displayed in the notification. +The **NotificationActionButton** module provides APIs for defining 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. +## Attributes + **System capability**: SystemCapability.Notification.Notification | Name | Type | Read-only| Mandatory| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md index 9f5de8d911f2533c0dd789fd3bce1eeaf1adeef6..9c7e8d79d55ac7c33b3d77f5eae63670a403fc3f 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md @@ -1,11 +1,13 @@ # NotificationContent -The **NotificationContent** module describes the notification content. +The **NotificationContent** module provides APIs for defining 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. +## NotificationContent + **System capability**: SystemCapability.Notification.Notification | Name | Type | Read-only| Mandatory| Description | @@ -22,11 +24,11 @@ Describes the normal text notification. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| -------------- | ------ | ---- | ---- | ---------------------------------- | -| title | string | No | Yes | Notification title. | -| text | string | No | Yes | Notification content. | -| additionalText | string | No | No | Additional information of the notification.| +| Name | Type | Mandatory| Description | +| -------------- | ------ | ---- | ---------------------------------- | +| title | string | Yes | Notification title. | +| text | string | Yes | Notification content. | +| additionalText | string | No | Additional information of the notification.| ## NotificationLongTextContent @@ -35,14 +37,14 @@ Describes the long text notification. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| -------------- | ------ | ---- | --- | -------------------------------- | -| title | string | No | Yes | Notification title. | -| text | string | No | Yes | Notification content. | -| additionalText | string | No | No | Additional information of the notification.| -| longText | string | No | Yes | Long text of the notification. | -| briefText | string | No | Yes | Brief text of the notification. | -| expandedTitle | string | No | Yes | Title of the notification in the expanded state. | +| Name | Type | Mandatory| Description | +| -------------- | ------ | --- | -------------------------------- | +| title | string | Yes | Notification title. | +| text | string | Yes | Notification content. | +| additionalText | string | No | Additional information of the notification. | +| longText | string | Yes | Long text of the notification. | +| briefText | string | Yes | Brief text of the notification. | +| expandedTitle | string | Yes | Title of the notification in the expanded state. | ## NotificationMultiLineContent @@ -67,11 +69,11 @@ Describes the picture-attached notification. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | -| -------------- | -------------- | ---- | --- | -------------------------------- | -| title | string | No | Yes | Notification title. | -| text | string | No | Yes | Notification content. | +| Name | Type | Readable| Writable| Description | +| -------------- | -------------- | ---- | --- |-------------| +| title | string | No | Yes | Notification title. | +| text | string | No | Yes | Notification content. | | additionalText | string | No | No | Additional information of the notification.| | briefText | string | No | Yes | Brief text of the notification.| -| expandedTitle | string | No | Yes | Title of the notification in the expanded state. | -| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Yes | Picture attached to the notification. | +| expandedTitle | string | No | Yes | Title of the notification in the expanded state. | +| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Yes | Picture attached to the notification. The maximum size is 2 MB. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md index e0b84a9fbac8e59070b598960bdb447c9cc24dbe..edf0b445aa548f6b617088dcd7b9445f93307bb2 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md @@ -8,10 +8,10 @@ The **NotificationFlags** module implements a **NotificationFlags** instance. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| 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. | +| Name | Type | Mandatory| Description | +| ---------------- | ---------------------- | ---- | --------------------------------- | +| soundEnabled | [NotificationFlagStatus](#notificationflagstatus) | No | Whether to enable the sound alert for the notification. | +| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus) | No | Whether to enable vibration for the notification. | ## NotificationFlagStatus diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md index ac3646f424f7701e2fa85c671a76ba90c511d212..9ad267c45ee6c702c5e81af064f169b74dc597ac 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md @@ -1,52 +1,54 @@ # NotificationRequest -The **NotificationRequest** module describes the notification request. +The **NotificationRequest** module provides APIs for defining 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. +## NotificationRequest + **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| --------------------- | --------------------------------------------- | ---- | --- | -------------------------- | -| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | No | Yes | Notification content. | -| id | number | No | No | Notification ID. | -| slotType | [SlotType](js-apis-notificationManager.md#slottype) | Yes | No | Notification slot type. | -| isOngoing | boolean | No | No | Whether the notification is an ongoing notification. | -| isUnremovable | boolean | No | No | Whether the notification can be removed. | -| deliveryTime | number | No | No | Time when the notification is sent. | -| tapDismissed | boolean | No | No | Whether the notification is automatically cleared. | -| autoDeletedTime | number | No | No | Time when the notification is automatically cleared. | -| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | No | **WantAgent** instance to which the notification will be redirected after being clicked.| -| extraInfo | {[key: string]: any} | No | No | Extended parameters. | -| color | number | No | No | Background color of the notification. Not supported currently.| -| colorEnabled | boolean | No | No | Whether the notification background color can be enabled. Not supported currently.| -| isAlertOnce | boolean | No | No | Whether the notification triggers an alert only once.| -| isStopwatch | boolean | No | No | Whether to display the stopwatch. | -| isCountDown | boolean | No | No | Whether to display the countdown time. | -| isFloatingIcon | boolean | No | No | Whether the notification is displayed as a floating icon in the status bar. | -| label | string | No | No | Notification label. | -| badgeIconStyle | number | No | No | Notification badge type. Not supported currently. | -| showDeliveryTime | boolean | No | No | Whether to display the time when the notification is delivered. | -| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | No | No | Buttons in the notification. Up to three buttons are allowed. | -| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | No | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.| -| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | No | 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. | -| creatorUid8+ | 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 | No | No | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | -| groupName8+ | string | No | No | Notification group name. | -| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | No | Notification template. | -| isRemoveAllowed8+ | boolean | Yes | No | Whether the notification can be removed.
**System API**: This is a system API and cannot be called by third-party applications. | -| source8+ | number | Yes | No | Notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| distributedOption8+ | [DistributedOptions](#distributedoptions) | No | No | Distributed notification options. | -| deviceId8+ | string | Yes | No | Device ID of the notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationFlags.md#notificationflags) | Yes | No | Notification flags. | -| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | No | No | **WantAgent** instance to which the notification will be redirected when it is removed. | -| badgeNumber9+ | number | No | No | Number of notifications displayed on the application icon. | +| Name | Type | Mandatory| Description | +| --------------------- | --------------------------------------------- | --- | -------------------------- | +| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | Yes | Notification content. | +| id | number | No | Notification ID. | +| slotType | [SlotType](js-apis-notificationManager.md#slottype) | No | Notification slot type. | +| isOngoing | boolean | No | Whether the notification is an ongoing notification. | +| isUnremovable | boolean | No | Whether the notification can be removed. | +| deliveryTime | number | No | Time when the notification is sent. | +| tapDismissed | boolean | No | Whether the notification is automatically cleared. | +| autoDeletedTime | number | No | Time when the notification is automatically cleared. | +| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | **WantAgent** instance to which the notification will be redirected after being clicked.| +| extraInfo | {[key: string]: any} | No | Extended parameters. | +| color | number | No | Background color of the notification. Not supported currently.| +| colorEnabled | boolean | No | Whether the notification background color can be enabled. Not supported currently.| +| isAlertOnce | boolean | No | Whether the notification triggers an alert only once.| +| isStopwatch | boolean | No | Whether to display the stopwatch. | +| isCountDown | boolean | No | Whether to display the countdown time. | +| isFloatingIcon | boolean | No | Whether the notification is displayed as a floating icon in the status bar. | +| label | string | No | Notification label. | +| badgeIconStyle | number | No | Notification badge type. Not supported currently. | +| showDeliveryTime | boolean | No | Whether to display the time when the notification is delivered. | +| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | No | Buttons in the notification. Up to three buttons are allowed. | +| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.| +| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Large notification icon. This field is optional, and the icon size cannot exceed 30 KB.| +| creatorBundleName | string | No | Name of the bundle that creates the notification. | +| creatorUid | number | No | UID used for creating the notification. | +| creatorPid | number | No | PID used for creating the notification. | +| creatorUserId8+ | number | No | ID of the user who creates the notification. | +| hashCode | string | No | Unique ID of the notification. | +| classification | string | No | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | +| groupName8+ | string | No | Notification group name. | +| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | Notification template. | +| isRemoveAllowed10+ | boolean | No | Whether the notification can be removed.
**System API**: This is a system API and cannot be called by third-party applications. | +| source8+ | number | No | Notification source.
**System API**: This is a system API and cannot be called by third-party applications. | +| distributedOption8+ | [DistributedOptions](#distributedoptions) | No | Distributed notification options. | +| deviceId8+ | string | No | Device ID of the notification source.
**System API**: This is a system API and cannot be called by third-party applications. | +| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationFlags.md#notificationflags) | No | Notification flags. | +| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | No | **WantAgent** instance to which the notification will be redirected when it is removed. | +| badgeNumber9+ | number | No | Number of notifications displayed on the application icon. | ## DistributedOptions @@ -55,9 +57,9 @@ Describes distributed notification options. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| ---------------------- | -------------- | ---- | ---- | ---------------------------------- | -| isDistributed8+ | boolean | No | No | Whether the notification is a distributed notification. | -| supportDisplayDevices8+ | Array\ | No | No | List of the devices to which the notification can be synchronized. | -| supportOperateDevices8+ | Array\ | No | No | List of the devices on which the notification can be opened. | -| remindType8+ | number | Yes | No | Notification reminder type.
**System API**: This is a system API and cannot be called by third-party applications. | +| Name | Type | Mandatory| Description | +| ---------------------- | -------------- | ---- | ---------------------------------- | +| isDistributed8+ | boolean | No | Whether the notification is a distributed notification. | +| supportDisplayDevices8+ | Array\ | No | List of the devices to which the notification can be synchronized. | +| supportOperateDevices8+ | Array\ | No | List of the devices on which the notification can be opened. | +| remindType8+ | number | No | Notification reminder type.
**System API**: This is a system API and cannot be called by third-party applications. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md index 9757ef2c007501439c509adc691e8f57aa3b354c..46d7400f092c282fd54581c0a93702dbee12df8e 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md @@ -1,24 +1,26 @@ # NotificationSlot -The **NotificationSlot** module describes the notification slot. +The **NotificationSlot** module provides APIs for defining 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. +## NotificationSlot + **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | -| type | [SlotType](js-apis-notificationManager.md#slottype) | No | Yes | Notification slot type. | -| level | number | No | No | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.| -| desc | string | No | No | Notification slot description. | -| badgeFlag | boolean | No | No | Whether to display the badge. | -| bypassDnd | boolean | No | No | Whether to bypass DND mode in the system. | -| lockscreenVisibility | number | No | No | Mode for displaying the notification on the lock screen. | -| vibrationEnabled | boolean | No | No | Whether to enable vibration for the notification. | -| sound | string | No | No | Notification alert tone. | -| lightEnabled | boolean | No | No | Whether the indicator blinks for the notification. | -| lightColor | number | No | No | Indicator color of the notification. | -| vibrationValues | Array\ | No | No | Vibration mode of the notification. | -| enabled9+ | boolean | Yes | No | Whether the notification slot is enabled. | +| Name | Type | Mandatory| Description | +| -------------------- | --------------------- | --- | ------------------------------------------ | +| type | [SlotType](js-apis-notificationManager.md#slottype) | Yes | Notification slot type. | +| level | number | No | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.| +| desc | string | No | Notification slot description. | +| badgeFlag | boolean | No | Whether to display the badge. | +| bypassDnd | boolean | No | Whether to bypass DND mode in the system. | +| lockscreenVisibility | number | No | Mode for displaying the notification on the lock screen. | +| vibrationEnabled | boolean | No | Whether to enable vibration for the notification. | +| sound | string | No | Notification alert tone. | +| lightEnabled | boolean | No | Whether the indicator blinks for the notification. | +| lightColor | number | No | Indicator color of the notification. | +| vibrationValues | Array\ | No | Vibration mode of the notification. | +| enabled9+ | boolean | No | Whether the notification slot is enabled. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md index 8062a16f3ac0305025130bcd73f91bd41ba6abdf..73a6bab743f76ff7d139723b0c491b35bcb3772b 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md @@ -1,17 +1,19 @@ # NotificationSorting -Provides sorting information of active notifications. +The **NotificationSorting** module provides APIs for defining the sorting information of active notifications. > **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. +## Attributes + **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | -| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | -| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 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 | Description of the notification slot. | +| Name | Type | Mandatory| Description | +| -------------------- | --------------------- | --- | ------------------------------------------ | +| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Notification slot type. | +| level | number | Yes | Notification level. If this parameter is not set, the default value is used based on the notification slot type.| +| desc | string | Yes | Description of the notification slot. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md index 0e75e98d2ce00b55aefc7d640f6590332782b451..443f773ae5f5a87881224d11f3e24566fa9e807d 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md @@ -1,17 +1,18 @@ # NotificationSortingMap -Provides sorting information of active notifications in all subscribed notifications. +The **NotificationSortingMap** module provides APIs for defining the sorting information of active notifications in all subscribed notifications. > **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. +## Attributes + **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | -| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | -| sortings | { [key: string]: [NotificationSorting](js-apis-inner-notification-notificationSorting.md) } | Yes | Yes | Array of notification sorting information.| -| sortedHashCode | Array\ | Yes | Yes | Hash codes for notification sorting.| - +| Name | Type | Mandatory| Description | +| -------------------- | --------------------- | --- | ------------------------------------------ | +| sortings | { [key: string]: [NotificationSorting](js-apis-inner-notification-notificationSorting.md) } | Yes | Array of notification sorting information.| +| sortedHashCode | Array | Yes | Hash codes for notification sorting.| diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md index 8bd477d99c99ba3cc5f494b12fb83c993b0ca682..34a1b47aeb1402a5e1fa65ebc63bf7b92750a57b 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md @@ -1,16 +1,18 @@ # NotificationSubscribeInfo -Provides the information about the publisher for notification subscription. +The **NotificationSubscribeInfo** module provides APIs for defining the information about the publisher for notification subscription. > **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. +## NotificationSubscribeInfo + **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | -| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | -| bundleNames | Array\ | No | No | Bundle names of the applications whose notifications are to be subscribed to. | -| userId | number | No | No | User ID. | +| Name | Type | Mandatory| Description | +| -------------------- | --------------------- | --- | ------------------------------------------ | +| bundleNames | Array | No | Bundle names of the applications whose notifications are to be subscribed to. | +| userId | number | No | User ID. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md index cd23687ebc1da6055172deede38ab03b62e68c0c..e779f74ec916d89392757ae6e2c19f05819d0fda 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md @@ -1,6 +1,6 @@ # NotificationSubscriber -Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](js-apis-notificationSubscribe.md). +The **NotificationSubscriber** module provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](js-apis-notificationSubscribe.md). > **NOTE** > @@ -283,7 +283,7 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); ### onEnabledNotificationChanged8+ -onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)) => void +onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)) => void Listens for the notification enabled status changes. @@ -295,7 +295,7 @@ Listens for the notification enabled status changes. | Name| Type| Mandatory| Description| | ------------ | ------------------------ | ---- | -------------------------- | -| callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)\> | Yes| Callback used to return the result.| +| callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata)\> | Yes| Callback used to return the result.| **Example** @@ -367,9 +367,9 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | +| Name | Type | Readable| Writable| Description | | --------------- | ------------------------------------------------- | ---- | --- | -------- | -| request | [NotificationRequest](js-apis-inner-notification-notificationRequest#notificationrequest) | Yes | Yes | Notification content.| +| request | [NotificationRequest](js-apis-inner-notification-notificationRequest#notificationrequest) | Yes | No | Notification content.| | sortingMap | [NotificationSortingMap](js-apis-inner-notification-notificationSortingMap.md) | Yes | No | Notification sorting information.| | reason | number | Yes | No | Reason for deletion.| | sound | string | Yes | No | Sound used for notification.| @@ -382,11 +382,11 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | +| Name | Type | Readable| Writable| Description | | ------ | ------- | ---- | --- | ---------------- | -| bundle | string | Yes | Yes | Bundle name of the application. | -| uid | number | Yes | Yes | UID of the application. | -| enable | boolean | Yes | Yes | Notification enabled status of the application.| +| 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.| ## BadgeNumberCallbackData10+ @@ -395,8 +395,8 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Read-only| Mandatory| Description | +| Name | Type | Readable| Writable| Description | | ----------- | ------ | ---- | ---- | ------------ | -| bundle | string | Yes | Yes | Bundle name of the application.| -| uid | number | Yes | Yes | UID of the application. | -| badgeNumber | number | Yes | Yes | Number of notifications displayed on the application icon. | +| bundle | string | Yes | No | Bundle name of the application.| +| uid | number | Yes | No | UID of the application. | +| badgeNumber | number | Yes | No | Number of notifications displayed on the application icon. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md index 3f9825e1d8cf63848d70e2282498e0d85f37cab0..de2aae91b588d075668f686d90fc8df538cef501 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md @@ -6,9 +6,11 @@ The **NotificationTemplate** module describes the notification template. > > 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. +## Attributes + **System capability**: SystemCapability.Notification.Notification -| Name| Type | Read-only| Mandatory| Description | -| ---- | ---------------------- | ---- | ---- | ---------- | -| name | string | No | Yes | Template name.| -| data | {[key:string]: Object} | No | Yes | Template data.| +| Name| Type | Mandatory| Description | +| ---- | ---------------------- | ---- | ---------- | +| name | string | Yes | Template name.| +| data | {[key:string]: Object} | Yes | Template data.| diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md index bfda17b7872a816c4eb05a3af9fc5c10098f0a90..fc8cf429e2b8ecb0b7d904eb03f068fff9790493 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md @@ -1,13 +1,15 @@ # NotificationUserInput -The **NotificationUserInput** module provides the notification user input. +The **NotificationUserInput** module provides APIs for defining 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. +## NotificationUserInput + **System capability**: SystemCapability.Notification.Notification -| Name | Type | Read-only| Mandatory| Description | -| -------- | ------ | --- | ---- | ----------------------------- | -| inputKey | string | No | Yes | Key to identify the user input.| +| Name | Type | Mandatory| Description | +| -------- | ------ | ---- | ----------------------------- | +| inputKey | string | Yes | Key to identify the user input.| diff --git a/en/application-dev/reference/apis/js-apis-notificationManager.md b/en/application-dev/reference/apis/js-apis-notificationManager.md index 8d3bc45b1f8ab4049fa905fe4546593fc5bd52f6..b993f99fcba29fa6bfef5bd78b8b268340844c86 100644 --- a/en/application-dev/reference/apis/js-apis-notificationManager.md +++ b/en/application-dev/reference/apis/js-apis-notificationManager.md @@ -3972,12 +3972,12 @@ try{ **System capability**: SystemCapability.Notification.Notification | Name | Value | Description | -| --------------------------------- | ----------- | ------------------ | -| NOTIFICATION_CONTENT_BASIC_TEXT | NOTIFICATION_CONTENT_BASIC_TEXT | Normal text notification. | -| NOTIFICATION_CONTENT_LONG_TEXT | NOTIFICATION_CONTENT_LONG_TEXT | Long text notification. | -| NOTIFICATION_CONTENT_PICTURE | NOTIFICATION_CONTENT_PICTURE | Picture-attached notification. | -| NOTIFICATION_CONTENT_CONVERSATION | NOTIFICATION_CONTENT_CONVERSATION | Conversation notification. | -| NOTIFICATION_CONTENT_MULTILINE | NOTIFICATION_CONTENT_MULTILINE | Multi-line text notification.| +| --------------------------------- | ----------- |------------------| +| NOTIFICATION_CONTENT_BASIC_TEXT | NOTIFICATION_CONTENT_BASIC_TEXT | Normal text notification. | +| NOTIFICATION_CONTENT_LONG_TEXT | NOTIFICATION_CONTENT_LONG_TEXT | Long text notification. | +| NOTIFICATION_CONTENT_PICTURE | NOTIFICATION_CONTENT_PICTURE | Picture-attached notification. | +| NOTIFICATION_CONTENT_CONVERSATION | NOTIFICATION_CONTENT_CONVERSATION | Conversation notification (not supported currently).| +| NOTIFICATION_CONTENT_MULTILINE | NOTIFICATION_CONTENT_MULTILINE | Multi-line text notification. | ## SlotLevel