diff --git a/en/application-dev/reference/apis/js-apis-reminderAgentManager.md b/en/application-dev/reference/apis/js-apis-reminderAgentManager.md index 7d56973be54adf176ce6c22519cb125079f19df3..4380dd084573117be6f2ea5db284969884cad0a3 100644 --- a/en/application-dev/reference/apis/js-apis-reminderAgentManager.md +++ b/en/application-dev/reference/apis/js-apis-reminderAgentManager.md @@ -570,6 +570,7 @@ Enumerates button types. | -------- | -------- | -------- | | ACTION_BUTTON_TYPE_CLOSE | 0 | Button for closing the reminder.| | ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.| +| ACTION_BUTTON_TYPE_CUSTOM10+ | 2 | Custom button. (This is a system API.)| ## ReminderType @@ -587,7 +588,7 @@ Enumerates reminder types. ## ActionButton -Defines a button displayed in the reminder notification. +Defines a button displayed for the reminder in the notification panel. **System capability**: SystemCapability.Notification.ReminderAgent @@ -595,18 +596,19 @@ Defines a button displayed in the reminder notification. | -------- | -------- | -------- | -------- | | title | string | Yes| Text on the button.| | type | [ActionButtonType](#actionbuttontype) | Yes| Button type.| +| wantAgent10+ | [WantAgent](#wantagent) | No| Ability information that is displayed after the button is clicked. (This is a system API.)| ## WantAgent -Sets the package and ability that are redirected to when the reminder notification is clicked. +Defines the information about the redirected-to ability. **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| pkgName | string | Yes| Name of the HAP that is redirected to when the reminder notification is clicked.| -| abilityName | string | Yes| Name of the ability that is redirected to when the reminder notification is clicked.| +| pkgName | string | Yes| Name of the target package.| +| abilityName | string | Yes| Name of the target ability.| ## MaxScreenWantAgent @@ -617,7 +619,7 @@ Provides the information about the target package and ability to start automatic | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| pkgName | string | Yes| Name of the HAP that is automatically started when the reminder arrives and the device is not in use.| +| pkgName | string | Yes| Name of the package that is automatically started when the reminder arrives and the device is not in use.| | abilityName | string | Yes| Name of the ability that is automatically started when the reminder arrives and the device is not in use.| @@ -630,18 +632,20 @@ Defines the reminder to publish. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | reminderType | [ReminderType](#remindertype) | Yes| Type of the reminder.| -| actionButton | [ActionButton](#actionbutton) | No| Button displayed in the reminder notification. (The parameter is optional. Up to two buttons are supported.)| -| wantAgent | [WantAgent](#wantagent) | No| Information about the ability that is redirected to when the notification is clicked.| +| actionButton | [ActionButton](#actionbutton) | No| Button displayed for the reminder in the notification panel. For common applications, a maximum of two buttons are supported. For system applications, a maximum of two buttons are supported in API version 9, and a maximum of three buttons are supported in API version 10 and later versions. | +| wantAgent | [WantAgent](#wantagent) | No| Information about the ability that is redirected to when the reminder is clicked.| | maxScreenWantAgent | [MaxScreenWantAgent](#maxscreenwantagent) | No| Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed.| | ringDuration | number | No| Ringing duration, in seconds. The default value is **1**.| | snoozeTimes | number | No| Number of reminder snooze times. The default value is **0**.| -| timeInterval | number | No| Reminder snooze interval, in seconds. The default value is **0**.| +| timeInterval | number | No| Reminder snooze interval, in seconds. The minimum value is 5 minutes.| | title | string | No| Reminder title.| | content | string | No| Reminder content.| | expiredContent | string | No| Content to be displayed after the reminder expires.| | snoozeContent | string | No| Content to be displayed when the reminder is snoozing.| | notificationId | number | No| Notification ID used by the reminder. If there are reminders with the same notification ID, the later one will overwrite the earlier one.| -| slotType | [notification.SlotType](js-apis-notification.md#slottype) | No| Type of the slot used by the reminder.| +| slotType | [notification.SlotType](js-apis-notificationManager.md#slottype) | No| Type of the slot used by the reminder.| +| tapDismissed10+ | boolean | No| Whether the notification is automatically cleared. The value is the same as that of [NotificationRequest.tapDismissed](js-apis-inner-notification-notificationRequest.md#notificationrequest).| +| autoDeletedTime10+ | number | No| Time when the notification is automatically cleared. The value is the same as that of [NotificationRequest.autoDeletedTime](js-apis-inner-notification-notificationRequest.md#notificationrequest).| ## ReminderRequestCalendar diff --git a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md index 5ba1e47b2f1d702e226ec3359044309b44a7dacb..ab02ed0f2c5bf6bf553f6a36f6a94442db2bb378 100644 --- a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @@ -130,7 +130,7 @@ Obtains the latest task status. This API uses an asynchronous callback to return | Name | Type | Mandatory | Description | | -------- | ------------------------------------- | ---- | ---------------------------------------- | | workId | number | Yes | Task ID. | -| callback | AsyncCallback\<[WorkInfo](#workinfo)> | Yes | Callback used to return the result. Returns the task status obtained from the **WorkSchedulerService** if the specified task ID is valid; returns **null** otherwise.| +| callback | AsyncCallback\<[WorkInfo](#workinfo)> | Yes | Callback used to return the result. Returns the task status obtained from the **WorkSchedulerService** if the specified task ID is valid; throws an exception otherwise.| **Error codes** @@ -178,7 +178,7 @@ Obtains the latest task status. This API uses a promise to return the result. | Type | Description | | ------------------------------- | ---------------------------------------- | -| Promise\<[WorkInfo](#workinfo)> | Promise used to return the result. Returns the task status obtained from the **WorkSchedulerService** if the specified task ID is valid; returns **null** otherwise.| +| Promise\<[WorkInfo](#workinfo)> | Promise used to return the result. Returns the task status obtained from the **WorkSchedulerService** if the specified task ID is valid; throws an exception otherwise.| **Error codes** diff --git a/en/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md b/en/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md index b74df9ec5663370f4d47e27eea0f71f100087479..9b166e1ca38d5022c9f6bbb6522b1b8ca7a098b2 100644 --- a/en/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md +++ b/en/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md @@ -36,8 +36,8 @@ The number of reminders exceeds the limit when **publishReminder()** is called. **Possible Causes** -1. There are already 2000 reminders for the entire system. -2. There are already 30 reminders for the application. +1. The number of reminders generated for the entire system exceeds 2000 in API version 9 or 12000 in API version 10 or later. +2. The number of reminders generated for the application exceeds 30 in API version 9 or 30 (for a common application) or 10000 (for a system application) in API version 10 or later. **Solution** diff --git a/en/application-dev/task-management/reminder-agent-development.md b/en/application-dev/task-management/reminder-agent-development.md index 2362e39c3a4f34213f19687d0377eed140a446a1..dd6d26f25a507adbd9168e647210e069b611acdb 100644 --- a/en/application-dev/task-management/reminder-agent-development.md +++ b/en/application-dev/task-management/reminder-agent-development.md @@ -7,14 +7,14 @@ The agent-powered reminder feature provides APIs for publishing background remin **Table 1** Major APIs in reminderAgentManager -| API | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void
publishReminder(reminderReq: ReminderRequest): Promise<number> | Publishes a scheduled reminder.
The maximum number of valid notifications (excluding expired ones that will not pop up again) is 30 for one application and 2000 for the entire system. | -| cancelReminder(reminderId: number, callback: AsyncCallback<void>): void
cancelReminder(reminderId: number): Promise<void> | Cancels a specified reminder. (The value of **reminderId** is obtained from the return value of **publishReminder**.) | -| getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void
getValidReminders(): Promise<Array<ReminderRequest>> | Obtains all valid reminders set by the current application. | -| cancelAllReminders(callback: AsyncCallback<void>): void
cancelAllReminders(): Promise<void> | Cancels all reminders set by the current application. | -| addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void
addNotificationSlot(slot: NotificationSlot): Promise<void> | Registers a **NotificationSlot** instance to be used by the reminder. | -| removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void
removeNotificationSlot(slotType: notification.SlotType): Promise<void> | Removes a **NotificationSlot** instance of a specified type. | +| API | Description | +| ---------------------------------------- | ---------------------------------------- | +| publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void
publishReminder(reminderReq: ReminderRequest): Promise<number> | Publishes a scheduled reminder.
The maximum number of valid notifications (excluding expired ones that will not pop up again) is 30 for one application
and 2000 for the entire system.| +| cancelReminder(reminderId: number, callback: AsyncCallback<void>): void
cancelReminder(reminderId: number): Promise<void> | Cancels a specified reminder. (The value of **reminderId** is obtained from the return value of **publishReminder**.)| +| getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void
getValidReminders(): Promise<Array<ReminderRequest>> | Obtains all valid reminders set by the current application. | +| cancelAllReminders(callback: AsyncCallback<void>): void
cancelAllReminders(): Promise<void> | Cancels all reminders set by the current application. | +| addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void
addNotificationSlot(slot: NotificationSlot): Promise<void> | Registers a **NotificationSlot** instance to be used by the reminder. | +| removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void
removeNotificationSlot(slotType: notification.SlotType): Promise<void> | Removes a **NotificationSlot** instance of a specified type. | ## How to Develop @@ -37,7 +37,7 @@ The agent-powered reminder feature provides APIs for publishing background remin let targetReminderAgent: reminderAgentManager.ReminderRequestTimer = { reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER, // The reminder type is countdown timer. triggerTimeInSeconds: 10, - actionButton: [ // Set the button type and title displayed in the reminder notification. The Close and Snooze types are supported, and the Snooze type must be used together with the snoozeTimes and timeInterval parameters. + actionButton: [ // Set the button type and title displayed for the reminder in the notification panel. { title: 'close', type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE @@ -73,7 +73,7 @@ The agent-powered reminder feature provides APIs for publishing background remin }, repeatMonths: [1], // Month in which the reminder repeats. repeatDays: [1], // Date on which the reminder repeats. - actionButton: [ // Set the button type and title displayed in the reminder notification. The Close and Snooze types are supported, and the Snooze type must be used together with the snoozeTimes and timeInterval parameters. + actionButton: [ // Set the button type and title displayed for the reminder in the notification panel. { title: 'close', type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE @@ -93,7 +93,7 @@ The agent-powered reminder feature provides APIs for publishing background remin }, ringDuration: 5, // Ringing duration, in seconds. snoozeTimes: 2, // Number of reminder snooze times. - timeInterval: 5, // Reminder snooze interval, in seconds. + timeInterval: 300, // Reminder snooze interval, in seconds. title: 'this is title', // Reminder title. content: 'this is content', // Reminder content. expiredContent: 'this reminder has expired', // Content to be displayed after the reminder expires. @@ -110,7 +110,7 @@ The agent-powered reminder feature provides APIs for publishing background remin hour: 23, // Hour portion of the reminder time. minute: 9, // Minute portion of the reminder time. daysOfWeek: [2], // Days of a week when the reminder repeats.. - actionButton: [ // Set the button type and title displayed in the reminder notification. The Close and Snooze types are supported, and the Snooze type must be used together with the snoozeTimes and timeInterval parameters. + actionButton: [ // Set the button type and title displayed for the reminder in the notification panel. { title: 'close', type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE @@ -130,7 +130,7 @@ The agent-powered reminder feature provides APIs for publishing background remin }, ringDuration: 5, // Ringing duration, in seconds. snoozeTimes: 2, // Number of reminder snooze times. - timeInterval: 5, // Reminder snooze interval, in seconds. + timeInterval: 300, // Reminder snooze interval, in seconds. title: 'this is title', // Reminder title. content: 'this is content', // Reminder content. expiredContent: 'this reminder has expired', // Content to be displayed after the reminder expires.