From 5611a87b9157ff3e1f2742dbe3a4856c2cafc56a Mon Sep 17 00:00:00 2001 From: rcy-hw Date: Fri, 15 Apr 2022 17:00:44 +0800 Subject: [PATCH] update api and user guide Signed-off-by: rcy-hw --- .../reference/apis/js-apis-reminderAgent.md | 10 ++++------ .../reference/apis/js-apis-reminderAgent.md | 16 ++++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-reminderAgent.md b/en/application-dev/reference/apis/js-apis-reminderAgent.md index 31db6beefe..d6ffafdf29 100644 --- a/en/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/en/application-dev/reference/apis/js-apis-reminderAgent.md @@ -269,15 +269,14 @@ Adds a reminder notification slot. This API uses an asynchronous callback to ret | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Reminder notification slot to add.| +| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Notification slot to add, only support set its type attribute.| | callback | AsyncCallback<void> | Yes| Asynchronous callback used to return the result.| **Example** ```js let mySlot = { - type: 3, - sound: "/sdcard/music2.mp3" + type: notification.SlotType.SOCIAL_COMMUNICATION } reminderAgent.addNotificationSlot(mySlot, (err, data) => { console.log("addNotificationSlot callback"); @@ -297,7 +296,7 @@ Adds a reminder notification slot. This API uses a promise to return the result. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Reminder notification slot to add.| +| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| notification slot to add, only support set its type attribute.| **Return value** @@ -309,8 +308,7 @@ Adds a reminder notification slot. This API uses a promise to return the result. ```js let mySlot = { - type: 3, - sound: "/sdcard/music2.mp3" + type: notification.SlotType.SOCIAL_COMMUNICATION } reminderAgent.addNotificationSlot(mySlot).then(() => { console.log("addNotificationSlot promise"); 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 7d9118b148..ef955e7827 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -269,15 +269,17 @@ addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>) | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例。 | +| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | | callback | AsyncCallback<void> | 是 | 异步回调。 | +**说明**: +使用NotificationSlot需要导入: import notification from '@ohos.notification' + **示例**: ```js let mySlot = { - type: 3, - sound: "/sdcard/music2.mp3" + type: notification.SlotType.SOCIAL_COMMUNICATION } reminderAgent.addNotificationSlot(mySlot, (err, data) => { console.log("addNotificationSlot callback"); @@ -297,7 +299,10 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例。 | +| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | + +**说明**: +使用NotificationSlot需要导入: import notification from '@ohos.notification' **返回值**: @@ -309,8 +314,7 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> ```js let mySlot = { - type: 3, - sound: "/sdcard/music2.mp3" + type: notification.SlotType.SOCIAL_COMMUNICATION } reminderAgent.addNotificationSlot(mySlot).then(() => { console.log("addNotificationSlot promise"); -- GitLab