From 4198fe335c75c8a28229a2429f951b94a1714699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Wed, 31 Aug 2022 17:01:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E9=86=92=E4=BB=A3=E7=90=86=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- ...ackground-agent-scheduled-reminder-guide.md | 18 +++++++++--------- .../reference/apis/js-apis-reminderAgent.md | 10 ++-------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md index 4d73ab1999..59e44267f2 100644 --- a/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md +++ b/zh-cn/application-dev/notification/background-agent-scheduled-reminder-guide.md @@ -1,4 +1,4 @@ -# 开发指导 +# 后台提醒开发指导 ## 场景介绍 @@ -13,12 +13,12 @@ reminderAgent:封装了发布、取消提醒类通知的方法 | 接口名 | 描述 | | -------- | -------- | -| function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void;
function publishReminder(reminderReq: ReminderRequest): Promise<number>; | 发布一个定时提醒类通知。
单个应用有效的提醒个数最多支持30个(不包括已经超时,即后续不会再提醒的提醒实例)
整个系统有效的提醒个数最多支持2000个(不包括已经超时,即后续不会再提醒的提醒实例) | -| function cancelReminder(reminderId: number, callback: AsyncCallback<void>): void;
function cancelReminder(reminderId: number): Promise<void>; | 取消一个指定的提醒类通知。(reminderId从publishReminder的返回值获取) | -| function getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void;
function getValidReminders(): Promise<Array<ReminderRequest>>; | 获取当前应用设置的所有有效的提醒。 | -| function cancelAllReminders(callback: AsyncCallback<void>): void;
function cancelAllReminders(): Promise<void>; | 取消当前应用设置的所有提醒 | -| function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void;
function addNotificationSlot(slot: NotificationSlot): Promise<void>; | 注册一个提醒类需要使用的NotificationSlot | -| function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void;
function removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | 删除指定类型的NotificationSlot | +| publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void
publishReminder(reminderReq: ReminderRequest): Promise<number> | 发布一个定时提醒类通知。
单个应用有效的提醒个数最多支持30个(不包括已经超时,即后续不会再提醒的提醒实例)
整个系统有效的提醒个数最多支持2000个(不包括已经超时,即后续不会再提醒的提醒实例) | +| cancelReminder(reminderId: number, callback: AsyncCallback<void>): void
cancelReminder(reminderId: number): Promise<void> | 取消一个指定的提醒类通知。(reminderId从publishReminder的返回值获取) | +| getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void
getValidReminders(): Promise<Array<ReminderRequest>> | 获取当前应用设置的所有有效的提醒。 | +| cancelAllReminders(callback: AsyncCallback<void>): void
cancelAllReminders(): Promise<void> | 取消当前应用设置的所有提醒 | +| addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void
addNotificationSlot(slot: NotificationSlot): Promise<void> | 注册一个提醒类需要使用的NotificationSlot | +| removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void
removeNotificationSlot(slotType: notification.SlotType): Promise<void> | 删除指定类型的NotificationSlot | enum ActionButtonType: 在提醒弹出的通知界面上的按钮的类型。 @@ -133,9 +133,9 @@ interface LocalDateTime:时间信息实例 ## 开发步骤 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - +> > 1. 应用需要配置权限:ohos.permission.PUBLISH_AGENT_REMINDER - +> > 2. 应用需要申请通知弹窗:[Notification.requestEnableNotification](../reference/apis/js-apis-notification.md#notificationrequestenablenotification8) 发布一个10秒倒计时提醒 diff --git a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md index c1d722353e..3a34f7ed29 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -19,10 +19,7 @@ import reminderAgent from'@ohos.reminderAgent'; publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void -发布一个后台代理提醒,使用callback方式实现异步调用。 - -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 应用需要申请通知弹窗:[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)。 +发布一个后台代理提醒,使用callback方式实现异步调用,该方法需要申请通知弹窗[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 **需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER @@ -51,10 +48,7 @@ publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number& publishReminder(reminderReq: ReminderRequest): Promise<number> -发布一个后台代理提醒,使用Promise方式实现异步调用。 - -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 应用需要申请通知弹窗:[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)。 +发布一个后台代理提醒,使用Promise方式实现异步调用,该方法需要申请通知弹窗[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 **需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER -- GitLab