From eac629adbbc2eadbbc0a72db408163848b567daa Mon Sep 17 00:00:00 2001 From: rcy-hw Date: Sat, 26 Mar 2022 14:46:34 +0800 Subject: [PATCH] move permission to function Signed-off-by: rcy-hw --- .../reference/apis/js-apis-reminderAgent.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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 e35a80d90a..03b20d12ce 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -11,17 +11,14 @@ import reminderAgent from'@ohos.reminderAgent'; ``` -## 权限 - -ohos.permission.PUBLISH_AGENT_REMINDER - - ## reminderAgent.publishReminder publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void 发布一个后台代理提醒,使用callback方式实现异步调用。 +**需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER + **系统能力**: SystemCapability.Notification.ReminderAgent **参数**: @@ -69,7 +66,7 @@ publishReminder(reminderReq: ReminderRequest): Promise<number> **示例**: ``` export default { - data: + data: {timer: { reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, triggerTimeInSeconds: 3 @@ -205,7 +202,7 @@ getValidReminders(): Promise<Array<ReminderRequest>> **示例**: ``` -reminderAgent.getValidReminders().then((reminders) => { +reminderAgent.getValidReminders().then((reminders) => { for (let i = 0; i < reminders.length; i++) { console.log("getValidReminders = " + reminders[i]); console.log("getValidReminders, reminderType = " + reminders[i].reminderType); @@ -248,7 +245,7 @@ cancelAllReminders(callback: AsyncCallback<void>): void **示例**: ``` -reminderAgent.cancelAllReminders((err, data) =>{ +reminderAgent.cancelAllReminders((err, data) =>{ console.log("do next")}) ``` -- GitLab