未验证 提交 16318b01 编写于 作者: O openharmony_ci 提交者: Gitee

!15834 cherry-pick fix notification error

Merge pull request !15834 from yuyaozhi/monthly_20221018
...@@ -131,6 +131,15 @@ ...@@ -131,6 +131,15 @@
- [CommonEventPublishData](js-apis-inner-commonEvent-commonEventPublishData.md) - [CommonEventPublishData](js-apis-inner-commonEvent-commonEventPublishData.md)
- [CommonEventSubscriber](js-apis-inner-commonEvent-commonEventSubscriber.md) - [CommonEventSubscriber](js-apis-inner-commonEvent-commonEventSubscriber.md)
- [CommonEventSubscribeInfo](js-apis-inner-commonEvent-commonEventSubscribeInfo.md) - [CommonEventSubscribeInfo](js-apis-inner-commonEvent-commonEventSubscribeInfo.md)
- notification
- [NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)
- [NotificationCommonDef](js-apis-inner-notification-notificationCommonDef.md)
- [NotificationContent](js-apis-inner-notification-notificationContent.md)
- [NotificationFlags](js-apis-inner-notification-notificationFlags.md)
- [NotificationRequest](js-apis-inner-notification-notificationRequest.md)
- [NotificationSlot](js-apis-inner-notification-notificationSlot.md)
- [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md)
- 包管理 - 包管理
- [@ohos.bundle.appControl (appControl模块)](js-apis-appControl.md) - [@ohos.bundle.appControl (appControl模块)](js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager模块)](js-apis-bundleManager.md) - [@ohos.bundle.bundleManager (bundleManager模块)](js-apis-bundleManager.md)
......
# BundleOption # NotificationCommonDef
BundleOption模块为指定应用的包信息。 > **说明:**
>
> **说明:** > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## BundleOption
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification BundleOption模块为指定应用的包信息。
| 名称 | 类型 | 必填 | 说明 | **系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
| ------ | ------ |---- | ------ |
| bundle | string | 是 | 应用的包信息。 | | 名称 | 类型 | 必填 | 说明 |
| uid | number | 否 | 用户ID。 | | ------ | ------ |---- | ------ |
| bundle | string | 是 | 应用的包信息。 |
| uid | number | 否 | 用户ID。 |
...@@ -893,8 +893,8 @@ function unsubscribeCallback(err) { ...@@ -893,8 +893,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
...@@ -925,8 +925,8 @@ unsubscribe(subscriber: NotificationSubscriber): Promise\<void\> ...@@ -925,8 +925,8 @@ unsubscribe(subscriber: NotificationSubscriber): Promise\<void\>
**示例:** **示例:**
```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
......
...@@ -1005,7 +1005,7 @@ setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCall ...@@ -1005,7 +1005,7 @@ setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCall
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
| callback | AsyncCallback\<void\> | 是 | 设定通知使能回调函数。 | | callback | AsyncCallback\<void\> | 是 | 设定通知使能回调函数。 |
...@@ -1054,7 +1054,7 @@ setNotificationEnable(bundle: BundleOption, enable: boolean): Promise\<void\> ...@@ -1054,7 +1054,7 @@ setNotificationEnable(bundle: BundleOption, enable: boolean): Promise\<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
**错误码:** **错误码:**
...@@ -1097,7 +1097,7 @@ isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>): ...@@ -1097,7 +1097,7 @@ isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\<boolean\>):
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | ------------------------ | | -------- | --------------------- | ---- | ------------------------ |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| callback | AsyncCallback\<void\> | 是 | 获取通知使能状态回调函数。 | | callback | AsyncCallback\<void\> | 是 | 获取通知使能状态回调函数。 |
**错误码:** **错误码:**
...@@ -1145,7 +1145,7 @@ isNotificationEnabled(bundle: BundleOption): Promise\<boolean\> ...@@ -1145,7 +1145,7 @@ isNotificationEnabled(bundle: BundleOption): Promise\<boolean\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
**返回值:** **返回值:**
...@@ -1237,7 +1237,7 @@ isNotificationEnabled(): Promise\<boolean\> ...@@ -1237,7 +1237,7 @@ isNotificationEnabled(): Promise\<boolean\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
**返回值:** **返回值:**
...@@ -1282,7 +1282,7 @@ displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<voi ...@@ -1282,7 +1282,7 @@ displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\<voi
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
| callback | AsyncCallback\<void\> | 是 | 设定角标使能回调函数。 | | callback | AsyncCallback\<void\> | 是 | 设定角标使能回调函数。 |
...@@ -1331,7 +1331,7 @@ displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\> ...@@ -1331,7 +1331,7 @@ displayBadge(bundle: BundleOption, enable: boolean): Promise\<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
**错误码:** **错误码:**
...@@ -1374,7 +1374,7 @@ isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void ...@@ -1374,7 +1374,7 @@ isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\<boolean\>): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | ------------------------ | | -------- | --------------------- | ---- | ------------------------ |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| callback | AsyncCallback\<void\> | 是 | 获取角标使能状态回调函数。 | | callback | AsyncCallback\<void\> | 是 | 获取角标使能状态回调函数。 |
**错误码:** **错误码:**
...@@ -1422,7 +1422,7 @@ isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\> ...@@ -1422,7 +1422,7 @@ isBadgeDisplayed(bundle: BundleOption): Promise\<boolean\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
**返回值:** **返回值:**
...@@ -1470,7 +1470,7 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCal ...@@ -1470,7 +1470,7 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCal
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | -------------------- | | -------- | --------------------- | ---- | -------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 是 | 通知通道。 | | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 是 | 通知通道。 |
| callback | AsyncCallback\<void\> | 是 | 设定通知通道回调函数。 | | callback | AsyncCallback\<void\> | 是 | 设定通知通道回调函数。 |
...@@ -1524,7 +1524,7 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\> ...@@ -1524,7 +1524,7 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 是 | 通知通道。 | | slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | 是 | 通知通道。 |
**错误码:** **错误码:**
...@@ -1570,7 +1570,7 @@ getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<Notificati ...@@ -1570,7 +1570,7 @@ getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array\<Notificati
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | -------------------- | | -------- | ---------------------------------------- | ---- | -------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| callback | AsyncCallback<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>> | 是 | 获取通知通道回调函数。 | | callback | AsyncCallback<Array\<[NotificationSlot](js-apis-inner-notification-notificationSlot.md)\>> | 是 | 获取通知通道回调函数。 |
**错误码:** **错误码:**
...@@ -1618,7 +1618,7 @@ getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>> ...@@ -1618,7 +1618,7 @@ getSlotsByBundle(bundle: BundleOption): Promise<Array\<NotificationSlot\>>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
**返回值:** **返回值:**
...@@ -1666,7 +1666,7 @@ getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): voi ...@@ -1666,7 +1666,7 @@ getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\<number\>): voi
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ---------------------- | | -------- | ------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
| callback | AsyncCallback\<number\> | 是 | 获取通知通道数量回调函数。 | | callback | AsyncCallback\<number\> | 是 | 获取通知通道数量回调函数。 |
**错误码:** **错误码:**
...@@ -1714,7 +1714,7 @@ getSlotNumByBundle(bundle: BundleOption): Promise\<number\> ...@@ -1714,7 +1714,7 @@ getSlotNumByBundle(bundle: BundleOption): Promise\<number\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ------------ | ---- | ---------- | | ------ | ------------ | ---- | ---------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 指定应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 指定应用的包信息。 |
**返回值:** **返回值:**
...@@ -2071,7 +2071,7 @@ removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCall ...@@ -2071,7 +2071,7 @@ removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCall
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| --------- | --------------------- | ---- | ---------------------------- | | --------- | --------------------- | ---- | ---------------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| groupName | string | 是 | 通知组名称。 | | groupName | string | 是 | 通知组名称。 |
| callback | AsyncCallback\<void\> | 是 | 删除指定应用指定组下通知的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 删除指定应用指定组下通知的回调函数。 |
...@@ -2121,7 +2121,7 @@ removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\> ...@@ -2121,7 +2121,7 @@ removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| --------- | ------------ | ---- | -------------- | | --------- | ------------ | ---- | -------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| groupName | string | 是 | 通知组名称。 | | groupName | string | 是 | 通知组名称。 |
**错误码:** **错误码:**
...@@ -2933,7 +2933,7 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: As ...@@ -2933,7 +2933,7 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: As
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| enable | boolean | 是 | 是否支持。 | | enable | boolean | 是 | 是否支持。 |
| callback | AsyncCallback\<void\> | 是 | 应用程序是否支持分布式通知的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 应用程序是否支持分布式通知的回调函数。 |
...@@ -2987,7 +2987,7 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise\<vo ...@@ -2987,7 +2987,7 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise\<vo
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包。 |
| enable | boolean | 是 | 是否支持。 | | enable | boolean | 是 | 是否支持。 |
**错误码:** **错误码:**
...@@ -3032,7 +3032,7 @@ isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback\<bool ...@@ -3032,7 +3032,7 @@ isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback\<bool
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包。 |
| callback | AsyncCallback\<boolean\> | 是 | 查询指定应用是否支持分布式通知的回调函数。 | | callback | AsyncCallback\<boolean\> | 是 | 查询指定应用是否支持分布式通知的回调函数。 |
**错误码:** **错误码:**
...@@ -3083,7 +3083,7 @@ isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean> ...@@ -3083,7 +3083,7 @@ isDistributedEnabledByBundle(bundle: BundleOption): Promise\<boolean>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------ | ---- | -------------------------- | | -------- | ------------------------ | ---- | -------------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包。 |
**返回值:** **返回值:**
...@@ -3440,7 +3440,7 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean, ...@@ -3440,7 +3440,7 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean,
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | ---------------------- | | -------- | ----------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| type | [SlotType](#slottype) | 是 | 指定渠道类型。 | | type | [SlotType](#slottype) | 是 | 指定渠道类型。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
| callback | AsyncCallback\<void\> | 是 | 设置渠道使能回调函数。 | | callback | AsyncCallback\<void\> | 是 | 设置渠道使能回调函数。 |
...@@ -3491,7 +3491,7 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean) ...@@ -3491,7 +3491,7 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean)
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ----------------------------- | ---- | -------------- | | ------ | ----------------------------- | ---- | -------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| type | [SlotType](#slottype) | 是 | 渠道类型。 | | type | [SlotType](#slottype) | 是 | 渠道类型。 |
| enable | boolean | 是 | 使能状态。 | | enable | boolean | 是 | 使能状态。 |
...@@ -3534,7 +3534,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC ...@@ -3534,7 +3534,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | ---------------------- | | -------- | ----------------------------- | ---- | ---------------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| type | [SlotType](#slottype) | 是 | 渠道类型。 | | type | [SlotType](#slottype) | 是 | 渠道类型。 |
| callback | AsyncCallback\<boolean\> | 是 | 获取渠道使能状态回调函数。 | | callback | AsyncCallback\<boolean\> | 是 | 获取渠道使能状态回调函数。 |
...@@ -3583,7 +3583,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\<boolea ...@@ -3583,7 +3583,7 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\<boolea
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ----------------------------- | ---- | -------------- | | ------ | ----------------------------- | ---- | -------------- |
| bundle | [BundleOption](./js-apis-inner-notification-bundleOption.md) | 是 | 应用的包信息。 | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | 是 | 应用的包信息。 |
| type | [SlotType](#slottype) | 是 | 渠道类型。 | | type | [SlotType](#slottype) | 是 | 渠道类型。 |
**返回值:** **返回值:**
......
...@@ -17,22 +17,22 @@ import notification from '@system.notification'; ...@@ -17,22 +17,22 @@ import notification from '@system.notification';
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification **系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | 名称 | 类型 | 必填 | 说明 |
| ----------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | | ----------- | ---------------------------------------------- | ---- | ------------------------- |
| bundleName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Bundle名。 | | bundleName | string | 是 | 单击通知后要重定向到的应用程序的Bundle名。 |
| abilityName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Ability名称。 | | abilityName | string | 是 | 单击通知后要重定向到的应用程序的Ability名称。 |
| uri | 是 | 是 | string | 否 | 要重定向到的页面的uri。 | | uri | string | 否 | 要重定向到的页面的uri。 |
## ShowNotificationOptions ## ShowNotificationOptions
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification **系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification
| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | 名称 | 类型 | 必填 | 说明 |
| ------------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | | ------------- | ---------------------------------------------- | ---- | ------------------------- |
| contentTitle | 是 | 是 | string | 否 | 通知标题。 | | contentTitle | string | 否 | 通知标题。 |
| contentText | 是 | 是 | string | 否 | 通知内容。 | | contentText | string | 否 | 通知内容。 |
| clickAction | 是 | 是 | ActionResult | 否 | 通知被点击后触发的行为。 | | clickAction | ActionResult | 否 | 通知被点击后触发的行为。 |
## notification.show ## notification.show
......
...@@ -933,6 +933,15 @@ ...@@ -933,6 +933,15 @@
- [CommonEventPublishData](reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md) - [CommonEventPublishData](reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md)
- [CommonEventSubscriber](reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md) - [CommonEventSubscriber](reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md)
- [CommonEventSubscribeInfo](reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md) - [CommonEventSubscribeInfo](reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md)
- notification
- [NotificationActionButton](reference/apis/js-apis-inner-notification-notificationActionButton.md)
- [NotificationCommonDef](reference/apis/js-apis-inner-notification-notificationCommonDef.md)
- [NotificationContent](reference/apis/js-apis-inner-notification-notificationContent.md)
- [NotificationFlags](reference/apis/js-apis-inner-notification-notificationFlags.md)
- [NotificationRequest](reference/apis/js-apis-inner-notification-notificationRequest.md)
- [NotificationSlot](reference/apis/js-apis-inner-notification-notificationSlot.md)
- [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md)
- [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md)
- 包管理 - 包管理
- [@ohos.bundle.appControl (appControl模块)](reference/apis/js-apis-appControl.md) - [@ohos.bundle.appControl (appControl模块)](reference/apis/js-apis-appControl.md)
- [@ohos.bundle.bundleManager (bundleManager模块)](reference/apis/js-apis-bundleManager.md) - [@ohos.bundle.bundleManager (bundleManager模块)](reference/apis/js-apis-bundleManager.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册