@@ -9,6 +9,12 @@ You can use the APIs of this module to start StaticSubscriberExtensionAbilities.
...
@@ -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 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.
> The APIs of this module can be used only in the stage model.
Before using the **StaticSubscriberExtensionContext** module, you must first obtain a **StaticSubscriberExtensionAbility** instance.
Before using the **StaticSubscriberExtensionContext** module, you must first obtain a **StaticSubscriberExtensionAbility** instance.
...
@@ -31,6 +37,8 @@ Observe the following when using this API:
...
@@ -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 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.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
**System API**: This is a system API and cannot be called by third-party applications.
**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:
...
@@ -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 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.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
@@ -4,7 +4,7 @@ The **StaticSubscriberExtensionAbility** module provides Extension abilities for
...
@@ -4,7 +4,7 @@ The **StaticSubscriberExtensionAbility** module provides Extension abilities for
> **NOTE**
> **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.
> The APIs of this module can be used only in the stage model.
## Modules to Import
## Modules to Import
...
@@ -15,11 +15,13 @@ import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriber
...
@@ -15,11 +15,13 @@ import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriber
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.
The **CommonEventData** module provides APIs for defining common event data.
> **NOTE**
> **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.
> 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.
The **CommonEventPublishData** module provides APIs for defining common event content and attributes.
> **NOTE**
> **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.
> 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.
> 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.
> 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.
The **NotificationActionButton** module describes the button displayed in the notification.
The **NotificationActionButton** module provides APIs for defining the button displayed in the notification.
> **NOTE**
> **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.
> 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.
The **NotificationContent** module describes the notification content.
The **NotificationContent** module provides APIs for defining the notification content.
> **NOTE**
> **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.
> 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.
The **NotificationRequest** module describes the notification request.
The **NotificationRequest** module provides APIs for defining the notification request.
> **NOTE**
> **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.
> 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.
| isOngoing | boolean | No | No | Whether the notification is an ongoing notification. |
| isOngoing | boolean | No | Whether the notification is an ongoing notification. |
| isUnremovable | boolean | No | No | Whether the notification can be removed. |
| isUnremovable | boolean | No | Whether the notification can be removed. |
| deliveryTime | number | No | No | Time when the notification is sent. |
| deliveryTime | number | No | Time when the notification is sent. |
| tapDismissed | boolean | No | No | Whether the notification is automatically cleared. |
| tapDismissed | boolean | No | Whether the notification is automatically cleared. |
| autoDeletedTime | number | No | No | Time when the notification is automatically cleared. |
| autoDeletedTime | number | 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.|
| 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 | No | Extended parameters. |
| color | number | No | No | Background color of the notification. Not supported currently.|
| color | number | No | Background color of the notification. Not supported currently.|
| colorEnabled | boolean | No | No | Whether the notification background color can be enabled. Not supported currently.|
| colorEnabled | boolean | No | Whether the notification background color can be enabled. Not supported currently.|
| isAlertOnce | boolean | No | No | Whether the notification triggers an alert only once.|
| isAlertOnce | boolean | No | Whether the notification triggers an alert only once.|
| isStopwatch | boolean | No | No | Whether to display the stopwatch. |
| isStopwatch | boolean | No | Whether to display the stopwatch. |
| isCountDown | boolean | No | No | Whether to display the countdown time. |
| isCountDown | boolean | No | Whether to display the countdown time. |
| isFloatingIcon | boolean | No | No | Whether the notification is displayed as a floating icon in the status bar. |
| isFloatingIcon | boolean | No | Whether the notification is displayed as a floating icon in the status bar. |
| label | string | No | No | Notification label. |
| label | string | No | Notification label. |
| badgeIconStyle | number | No | No | Notification badge type. Not supported currently. |
| badgeIconStyle | number | No | Notification badge type. Not supported currently. |
| showDeliveryTime | boolean | No | No | Whether to display the time when the notification is delivered. |
| showDeliveryTime | boolean | 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. |
| 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 | No | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.|
| 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 | No | Large 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 | Yes | No | Name of the bundle that creates the notification. |
| creatorBundleName | string | No | Name of the bundle that creates the notification. |
| creatorUid<sup>8+<sup> | number | Yes | No | UID used for creating the notification. |
| creatorUid | number | No | UID used for creating the notification. |
| creatorPid | number | Yes | No | PID used for creating the notification. |
| creatorPid | number | No | PID used for creating the notification. |
| creatorUserId | number | Yes | No | ID of the user who creates the notification. |
| creatorUserId<sup>8+<sup> | number | No | ID of the user who creates the notification. |
| hashCode | string | Yes | No | Unique ID of the notification. |
| hashCode | string | No | Unique ID of the notification. |
| classification | string | No | No | Notification category.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| classification | string | No | Notification category.<br>**System API**: This is a system API and cannot be called by third-party applications. |
| groupName<sup>8+<sup> | string | No | No | Notification group name. |
| groupName<sup>8+<sup> | string | No | Notification group name. |
| template<sup>8+<sup> | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | No | Notification template. |
| template<sup>8+<sup> | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | 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. |
| isRemoveAllowed<sup>10+<sup> | boolean | 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. |
| source<sup>8+<sup> | number | 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) | No | No | 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. |
| deviceId<sup>8+<sup> | string | 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.md#notificationflags) | No | Notification flags. |
| removalWantAgent<sup>9+<sup> | [WantAgent](js-apis-app-ability-wantAgent.md) | No | No | **WantAgent** instance to which the notification will be redirected when it is removed. |
| removalWantAgent<sup>9+<sup> | [WantAgent](js-apis-app-ability-wantAgent.md) | No | **WantAgent** instance to which the notification will be redirected when it is removed. |
| badgeNumber<sup>9+<sup> | number | No | No | Number of notifications displayed on the application icon. |
| badgeNumber<sup>9+<sup> | number | No | Number of notifications displayed on the application icon. |
| isDistributed<sup>8+<sup> | boolean | No | No | Whether the notification is a distributed notification. |
| isDistributed<sup>8+<sup> | boolean | No | Whether the notification is a distributed notification. |
| supportDisplayDevices<sup>8+<sup> | Array\<string> | No | No | List of the devices to which the notification can be synchronized. |
| supportDisplayDevices<sup>8+<sup> | Array\<string> | No | List of the devices to which the notification can be synchronized. |
| supportOperateDevices<sup>8+<sup> | Array\<string> | No | No | List of the devices on which the notification can be opened. |
| supportOperateDevices<sup>8+<sup> | Array\<string> | No | 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. |
| remindType<sup>8+<sup> | number | No | Notification reminder type.<br>**System API**: This is a system API and cannot be called by third-party applications. |
The **NotificationSlot** module describes the notification slot.
The **NotificationSlot** module provides APIs for defining the notification slot.
> **NOTE**
> **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.
> 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.
| level | number | No | No | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.|
| 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 | No | Notification slot description. |
Provides sorting information of active notifications.
The **NotificationSorting** module provides APIs for defining the sorting information of active notifications.
> **NOTE**
> **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.
> 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.
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**
> **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.
> 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.
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**
> **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.
> 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.
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).
| 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.|
@@ -6,9 +6,11 @@ The **NotificationTemplate** module describes the notification template.
...
@@ -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.
> 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.
The **NotificationUserInput** module provides the notification user input.
The **NotificationUserInput** module provides APIs for defining the notification user input.
> **NOTE**
> **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.
> 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.