diff --git a/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md b/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md index af3a0ef7b32ceef033874010047e12de41f0a67a..63e42760af0329365bd1a0379a21259dd3502c14 100644 --- a/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md +++ b/en/application-dev/background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md @@ -1,606 +1,214 @@ -# Agent-Powered Scheduled Reminder Development - -## When to Use - -You can set your application to call the **ReminderRequest** class to create scheduled reminders for countdown timers, calendar events, and alarm clocks. When the created reminders are published, the timing and pop-up notification functions of your application will be taken over by the reminder agent in the background, even when your application is frozen or exits. - -## Available APIs - -**reminderAgent** encapsulates the methods for publishing and canceling reminders. - -**Table 1** Major APIs in reminderAgent - - -
- | -- | -
---|---|
function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void; -function 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. - |
-
function cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; - - |
-Cancels a specified reminder. (The value of reminderId is obtained from the return value of publishReminder.) - |
-
function getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; -function getValidReminders(): Promise<Array<ReminderRequest>>; - |
-- | -
function cancelAllReminders(callback: AsyncCallback<void>): void; - - |
-- | -
function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; -function addNotificationSlot(slot: NotificationSlot): Promise<void>; - |
-Registers a NotificationSlot instance to be used by the reminder. - |
-
function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; -function removeNotificationSlot(slotType: notification.SlotType): Promise<void>; - |
-Removes a NotificationSlot instance of a specified type. - |
-
- | -- | -
---|---|
- | -Close button, which can be tapped to stop the reminder alert tone, close the reminder notification, and cancel the reminder snoozing. - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -[ActionButton?, ActionButton?] - |
-- | -- | -
- | -- | -- | -Information about the ability that is redirected to when the notification is clicked. - |
-
- | -- | -- | -Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -Extended content to be displayed when the reminder is snoozing. - |
-
- | -- | -- | -Notification ID used by the reminder. For details, see the API reference of the NotificationRequest::SetNotificationId(int32_t id) method. - |
-
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -ID of the timer to cancel, which is returned by setTimeout() - |
-
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -- | -
- | -- | -- | -- | -
- | -- | -- | -Additional parameter to pass to the handler after the timer goes off - |
-
- | -- | -
---|---|
- | -- | -
- | -- | -- | -- | -
---|---|---|---|
- | -- | -- | -ID of the repeating timer to cancel, which is returned by setInterval(). - |
-