diff --git a/en/application-dev/reference/apis/js-apis-reminderAgent.md b/en/application-dev/reference/apis/js-apis-reminderAgent.md index d6ffafdf295bc5390f9e7fa2916fc991f72b06d1..1913689ae7bd170ea0a315b5817e42515571e610 100644 --- a/en/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/en/application-dev/reference/apis/js-apis-reminderAgent.md @@ -275,6 +275,8 @@ Adds a reminder notification slot. This API uses an asynchronous callback to ret **Example** ```js +import notification from '@ohos.notification' + let mySlot = { type: notification.SlotType.SOCIAL_COMMUNICATION } @@ -307,6 +309,8 @@ Adds a reminder notification slot. This API uses a promise to return the result. **Example** ```js +import notification from '@ohos.notification' + let mySlot = { type: notification.SlotType.SOCIAL_COMMUNICATION } @@ -334,6 +338,8 @@ Removes a notification slot of a specified type. This API uses an asynchronous c **Example** ```js +import notification from '@ohos.notification' + reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => { console.log("removeNotificationSlot callback"); }); @@ -363,6 +369,8 @@ Removes a notification slot of a specified type. This API uses a promise to retu **Example** ```js +import notification from '@ohos.notification' + reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { console.log("removeNotificationSlot 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 ef955e7827297f19699faf7fb2738cb1d753410b..760ea666711673a61a1d2f44632eea628593cc47 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -272,12 +272,11 @@ addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>) | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | | callback | AsyncCallback<void> | 是 | 异步回调。 | -**说明**: -使用NotificationSlot需要导入: import notification from '@ohos.notification' - **示例**: ```js +import notification from '@ohos.notification' + let mySlot = { type: notification.SlotType.SOCIAL_COMMUNICATION } @@ -301,9 +300,6 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> | -------- | -------- | -------- | -------- | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification slot实例,仅支持设置其type属性。 | -**说明**: -使用NotificationSlot需要导入: import notification from '@ohos.notification' - **返回值**: | 类型 | 说明 | @@ -313,6 +309,8 @@ addNotificationSlot(slot: NotificationSlot): Promise<void> **示例**: ```js +import notification from '@ohos.notification' + let mySlot = { type: notification.SlotType.SOCIAL_COMMUNICATION } @@ -340,6 +338,8 @@ removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback& **示例**: ```js +import notification from '@ohos.notification' + reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => { console.log("removeNotificationSlot callback"); }); @@ -369,6 +369,8 @@ removeNotificationSlot(slotType: notification.SlotType): Promise<void> **示例**: ```js +import notification from '@ohos.notification' + reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { console.log("removeNotificationSlot promise"); });