From 2173f599040cba41c456de88203949d41adb749b Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Sat, 11 Feb 2023 14:45:03 +0800 Subject: [PATCH] fix docs Signed-off-by: fangJinliang1 Change-Id: I67907475203100088df4fa53c8df0ed138d324e0 Signed-off-by: fangJinliang1 --- .../apis/js-apis-app-ability-wantAgent.md | 4 +- .../apis/js-apis-notificationManager.md | 192 ++++++++++++++- .../apis/js-apis-notificationSubscribe.md | 28 +++ .../reference/apis/js-apis-wantAgent.md | 4 +- .../errorcodes/errorcode-notification.md | 219 ++++++++++++++++++ .../OpenHarmony_4.0.2.3/changelogs-ans.md | 21 ++ 6 files changed, 453 insertions(+), 15 deletions(-) create mode 100644 zh-cn/application-dev/reference/errorcodes/errorcode-notification.md create mode 100644 zh-cn/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md index 5aadd796d7..738fa467d0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md @@ -16,7 +16,7 @@ import WantAgent from '@ohos.app.ability.wantAgent'; getWantAgent(info: WantAgentInfo, callback: AsyncCallback\): void -创建WantAgent(callback形式)。 +创建WantAgent(callback形式)。 创建失败返回的WantAgent为空值。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -77,7 +77,7 @@ try { getWantAgent(info: WantAgentInfo): Promise\ -创建WantAgent(Promise形式)。 +创建WantAgent(Promise形式)。 创建失败返回的WantAgent为空值。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md b/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md index 7c53b3cd6e..082c541329 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationManager.md @@ -29,6 +29,8 @@ publish(request: NotificationRequest, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------------- | | 1600001 | Internal error. | @@ -82,6 +84,8 @@ publish(request: NotificationRequest): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------------- | | 1600001 | Internal error. | @@ -134,6 +138,8 @@ publish(request: NotificationRequest, userId: number, callback: AsyncCallback\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------------- | | 1600001 | Internal error. | @@ -244,6 +252,8 @@ cancel(id: number, label: string, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -284,6 +294,8 @@ cancel(id: number, label?: string): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -318,6 +330,8 @@ cancel(id: number, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -351,6 +365,8 @@ cancelAll(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -389,6 +405,8 @@ cancelAll(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -426,6 +444,8 @@ addSlot(slot: NotificationSlot, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -472,6 +492,8 @@ addSlot(slot: NotificationSlot): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -509,6 +531,8 @@ addSlot(type: SlotType, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -547,6 +571,8 @@ addSlot(type: SlotType): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -584,6 +610,8 @@ addSlots(slots: Array\, callback: AsyncCallback\): voi **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -634,6 +662,8 @@ addSlots(slots: Array\): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -675,6 +705,8 @@ getSlot(slotType: SlotType, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -720,6 +752,8 @@ getSlot(slotType: SlotType): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -753,6 +787,8 @@ getSlots(callback: AsyncCallback>): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -791,6 +827,8 @@ getSlots(): Promise\> **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -824,6 +862,8 @@ removeSlot(slotType: SlotType, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -863,6 +903,8 @@ removeSlot(slotType: SlotType): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -896,6 +938,8 @@ removeAllSlots(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -927,6 +971,8 @@ removeAllSlots(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -965,6 +1011,8 @@ setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCall **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1011,6 +1059,8 @@ setNotificationEnable(bundle: BundleOption, enable: boolean): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1052,6 +1102,8 @@ isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback\): **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1103,6 +1155,8 @@ isNotificationEnabled(bundle: BundleOption): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1143,6 +1197,8 @@ isNotificationEnabled(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1191,6 +1247,8 @@ isNotificationEnabled(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1230,6 +1288,8 @@ displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1317,6 +1379,8 @@ isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1368,6 +1432,8 @@ isBadgeDisplayed(bundle: BundleOption): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1410,6 +1476,8 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCal **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1461,6 +1529,8 @@ setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1505,6 +1575,8 @@ getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback> **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1597,6 +1671,8 @@ getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback\): voi **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1648,6 +1724,8 @@ getSlotNumByBundle(bundle: BundleOption): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -1689,6 +1767,8 @@ getAllActiveNotifications(callback: AsyncCallback>) **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1731,6 +1811,8 @@ getAllActiveNotifications(): Promise\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1801,6 +1885,8 @@ getActiveNotificationCount(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1833,6 +1919,8 @@ getActiveNotifications(callback: AsyncCallback>): v **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1871,6 +1959,8 @@ getActiveNotifications(): Promise\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1944,6 +2036,8 @@ cancelGroup(groupName: string): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -1983,6 +2077,8 @@ removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCall **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -2030,6 +2126,8 @@ removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -2070,6 +2168,8 @@ setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback\): vo **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2118,6 +2218,8 @@ setDoNotDisturbDate(date: DoNotDisturbDate): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2160,6 +2262,8 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallb **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2212,6 +2316,8 @@ setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2256,6 +2362,8 @@ getDoNotDisturbDate(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2298,6 +2406,8 @@ getDoNotDisturbDate(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2334,6 +2444,8 @@ getDoNotDisturbDate(userId: number, callback: AsyncCallback\) **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2385,6 +2497,8 @@ getDoNotDisturbDate(userId: number): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2403,9 +2517,9 @@ Notification.getDoNotDisturbDate(userId).then((data) => { ``` -## Notification.supportDoNotDisturbMode +## Notification.isSupportDoNotDisturbMode -supportDoNotDisturbMode(callback: AsyncCallback\): void +isSupportDoNotDisturbMode(callback: AsyncCallback\): void 查询是否支持免打扰功能(Callback形式)。 @@ -2423,6 +2537,8 @@ supportDoNotDisturbMode(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2432,22 +2548,22 @@ supportDoNotDisturbMode(callback: AsyncCallback\): void **示例:** ```js -function supportDoNotDisturbModeCallback(err,data) { +function isSupportDoNotDisturbModeCallback(err,data) { if (err) { - console.info("supportDoNotDisturbMode failed " + JSON.stringify(err)); + console.info("isSupportDoNotDisturbMode failed " + JSON.stringify(err)); } else { - console.info("supportDoNotDisturbMode success"); + console.info("isSupportDoNotDisturbMode success"); } } -Notification.supportDoNotDisturbMode(supportDoNotDisturbModeCallback); +Notification.isSupportDoNotDisturbMode(supportDoNotDisturbModeCallback); ``` -## Notification.supportDoNotDisturbMode +## Notification.isSupportDoNotDisturbMode -supportDoNotDisturbMode(): Promise\ +isSupportDoNotDisturbMode(): Promise\ 查询是否支持勿扰模式功能(Promise形式)。 @@ -2465,6 +2581,8 @@ supportDoNotDisturbMode(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2474,8 +2592,8 @@ supportDoNotDisturbMode(): Promise\ **示例:** ```js -Notification.supportDoNotDisturbMode().then((data) => { - console.info("supportDoNotDisturbMode success, data: " + JSON.stringify(data)); +Notification.isSupportDoNotDisturbMode().then((data) => { + console.info("isSupportDoNotDisturbMode success, data: " + JSON.stringify(data)); }); ``` @@ -2498,6 +2616,8 @@ isSupportTemplate(templateName: string, callback: AsyncCallback\): voi **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2544,6 +2664,8 @@ isSupportTemplate(templateName: string): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2579,6 +2701,8 @@ requestEnableNotification(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2611,6 +2735,8 @@ requestEnableNotification(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2648,6 +2774,8 @@ setDistributedEnable(enable: boolean, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2693,6 +2821,8 @@ setDistributedEnable(enable: boolean): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2727,6 +2857,8 @@ isDistributedEnabled(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2766,6 +2898,8 @@ isDistributedEnabled(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -2805,6 +2939,8 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: As **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -2856,6 +2992,8 @@ setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -2994,6 +3136,8 @@ getDeviceRemindType(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -3036,6 +3180,8 @@ getDeviceRemindType(): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -3074,6 +3220,8 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------------- | | 1600001 | Internal error. | @@ -3138,6 +3286,8 @@ publishAsBundle(request: NotificationRequest, representativeBundle: string, user **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------------- | | 1600001 | Internal error. | @@ -3198,6 +3348,8 @@ cancelAsBundle(id: number, representativeBundle: string, userId: number, callbac **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -3249,6 +3401,8 @@ cancelAsBundle(id: number, representativeBundle: string, userId: number): Promis **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -3293,6 +3447,8 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean, **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -3341,6 +3497,8 @@ setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean) **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -3382,6 +3540,8 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncC **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -3434,6 +3594,8 @@ isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -3862,7 +4032,7 @@ Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => { | label | string | 是 | 是 | 通知标签。 | | badgeIconStyle | number | 是 | 是 | 通知角标类型。 | | showDeliveryTime | boolean | 是 | 是 | 是否显示分发时间。 | -| actionButtons | Array\<[NotificationActionButton](#notificationactionbutton)\> | 是 | 是 | 通知按钮,最多两个按钮。 | +| actionButtons | Array\<[NotificationActionButton](#notificationactionbutton)\> | 是 | 是 | 通知按钮,最多三个按钮。 | | smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 是 | 通知小图标。可选字段,大小不超过30KB。 | | largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | 是 | 是 | 通知大图标。可选字段,大小不超过30KB。 | | creatorBundleName | string | 是 | 否 | 创建通知的包名。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscribe.md b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscribe.md index cc3438f5a4..a44e8a95f6 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscribe.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscribe.md @@ -36,6 +36,8 @@ subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, c **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -88,6 +90,8 @@ subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\): **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -136,6 +140,8 @@ subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -179,6 +185,8 @@ unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback\) **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -226,6 +234,8 @@ unsubscribe(subscriber: NotificationSubscriber): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -271,6 +281,8 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveRea **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -324,6 +336,8 @@ remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveRea **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -372,6 +386,8 @@ remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback\): **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -418,6 +434,8 @@ remove(hashCode: string, reason: RemoveReason): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -458,6 +476,8 @@ removeAll(bundle: BundleOption, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -503,6 +523,8 @@ removeAll(callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -545,6 +567,8 @@ removeAll(bundle?: BundleOption): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ---------------------------------------- | | 1600001 | Internal error. | @@ -582,6 +606,8 @@ removeAll(userId: number, callback: AsyncCallback\): void **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | @@ -625,6 +651,8 @@ removeAll(userId: number): Promise\ **错误码:** +错误码详细介绍请参考[errcode-notification](../errorcodes/errorcode-notification.md)。 + | 错误码ID | 错误信息 | | -------- | ----------------------------------- | | 1600001 | Internal error. | diff --git a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md index deeeb5de53..60ac715271 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @@ -16,7 +16,7 @@ import WantAgent from '@ohos.wantAgent'; getWantAgent(info: WantAgentInfo, callback: AsyncCallback\): void -创建WantAgent(callback形式)。 +创建WantAgent(callback形式)。 创建失败返回的WantAgent为空值。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -75,7 +75,7 @@ WantAgent.getWantAgent(wantAgentInfo, getWantAgentCallback); getWantAgent(info: WantAgentInfo): Promise\ -创建WantAgent(Promise形式)。 +创建WantAgent(Promise形式)。 创建失败返回的WantAgent为空值。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-notification.md b/zh-cn/application-dev/reference/errorcodes/errorcode-notification.md new file mode 100644 index 0000000000..e790eeaa9e --- /dev/null +++ b/zh-cn/application-dev/reference/errorcodes/errorcode-notification.md @@ -0,0 +1,219 @@ +# 元能力子系统错误码 + +## 1600001 内部错误 + +**错误信息** + +Internal error. + +**错误描述** + +多线程处理异常、内部指针校验错误等内部处理错误时,方法将返回该错误码。 + +**可能原因** + +多线程处理、内部处理异常等内核通用错误。 + +**处理步骤** + +确认系统资源是否足够。 + +## 1600002 序列化或反序列化错误 + +**错误信息** + +marshalling or unmarshalling error. + +**错误描述** + +数据传输前,进行序列化或反序列化错误,方法将返回该错误码。 + +**可能原因** + +应用与通知服务字段未匹配。 + +**处理步骤** + +检查应用sdk版本与系统版本是否匹配。 + +## 1600003 连接通知服务失败 + +**错误信息** + +Failed to connect service. + +**错误描述** + +应用连接通知服务失败,方法将返回该错误码。 + +**可能原因** + +通知服务繁忙或异常。 + +**处理步骤** + +重启系统。 + +## 1600004 通知开关关闭 + +**错误信息** + +Notification is not enabled. + +**错误描述** + +当通知开关为关闭状态时,方法将返回该错误码。 + +**可能原因** + +应用的通知开关为关闭状态。 + +**处理步骤** + +通知设置里开启应用通知开关。 + +## 1600005 通知渠道关闭 + +**错误信息** + +Notification slot is not enabled. + +**错误描述** + +当通知渠道关闭时,方法将返回该错误码。 + +**可能原因** + +通知渠道关闭状态,或未添加该类型渠道。 + +**处理步骤** + +1、通知设置里查看应用是否有该类型渠道,没有需要新增。 + +2、通知设置里查看应用该类型渠道状态,要保持开启状态。 + +## 1600006 通知删除失败 + +**错误信息** + +Notification is not allowed to remove. + +**错误描述** + +通知设置了禁止删除属性,方法将返回该错误码。 + +**可能原因** + +通知设置了禁止删除属性。 + +**处理步骤** + +参考[NotificationRequest](../apis/js-apis-notificationManager.md#notificationrequest)通知禁止删除属性。 + +## 1600007 通知不存在 + +**错误信息** + +The notification is not exist. + +**错误描述** + +通知服务未找到该通知,方法将返回该错误码。 + +**可能原因** + +通知已被取消或删除。 + +**处理步骤** + +无 + +## 1600008 用户不存在 + +**错误信息** + +The user is not exist. + +**错误描述** + +传入的用户信息系统里未查询到,方法将返回该错误码。 + +**可能原因** + +传入用户信息有误。 + +**处理步骤** + +检查传入的用户信息。 + +## 1600009 通知发布频度超过限制 + +**错误信息** + +Over max number notifications per second. + +**错误描述** + +通知发送频率超过限制,方法将返回该错误码。 + +**可能原因** + +通知发送频率超过每秒10个。 + +**处理步骤** + +降低通知发送频率。 + +## 16000010 分布式操作失败 + +**错误信息** + +Distributed operation failed. + +**错误描述** + +分布式数据库操作异常或分布式接口调用异常,方法将返回该错误码。 + +**可能原因** + +分布式数据库操作异常或分布式接口调用异常。 + +**处理步骤** + +检查分布式连接是否正常。 + +## 16000011 读模板配置文件错误 + +**错误信息** + +Read template config failed. + +**错误描述** + +模板配置文件读取异常,方法将返回该错误码。 + +**可能原因** + +系统中模板配置文件丢失。 + +**处理步骤** + +请检查系统中模板配置文件是否存在,配置文件路径:/system/etc/notification_template/external.json。 + +## 16000012 内存空间不够 + +**错误信息** + +No memory space. + +**错误描述** + +内存申请出现错误,方法将返回该错误码。 + +**可能原因** + +内存申请出现错误。 + +**处理步骤** + +确认系统内存是否足够。 diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md new file mode 100644 index 0000000000..4053bb4f9b --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.2.3/changelogs-ans.md @@ -0,0 +1,21 @@ +# ANS通知子系统ChangeLog + +## cl.notificationManager.1 接口名变更 + +基于此前接口名定义不够规范,与其他功能类型的接口命名不一致,对此接口名进行变更。 + +**变更影响** + +底层仍支持原接口功能,不影响4.0.2.3版本调用该接口的应用。 + +**关键接口/组件变更** + +| 包名 | 旧接口 | 新接口 | +| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(callback: AsyncCallback): **void**; | **function** isSupportDoNotDisturbMode(callback: AsyncCallback): **void**; | +| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(): Promise; | **function** isSupportDoNotDisturbMode(): Promise; | + +**适配指导** + +按新的接口isSupportDoNotDisturbMode调用。 + -- GitLab