Publishes a reminder through the reminder agent. This API uses an asynchronous callback to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8).
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder).
Publishes a reminder through the reminder agent. This API uses a promise to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8).
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder-1).
Cancels the reminder with the specified ID. This API uses an asynchronous callback to return the cancellation result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder).
Cancels the reminder with the specified ID. This API uses a promise to return the cancellation result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder-1).
Obtains all valid (not yet expired) reminders set by the current application. This API uses an asynchronous callback to return the reminders.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders).
| callback | AsyncCallback\<Array\<[ReminderRequest](#reminderrequest)\>\> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.|
| callback | AsyncCallback\<Array\<[ReminderRequest](#reminderrequest)\>\> | Yes| Callback used to return an array of all valid reminders set by the current application.|
Obtains all valid (not yet expired) reminders set by the current application. This API uses a promise to return the reminders.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders-1).
Cancels all reminders set by the current application. This API uses an asynchronous callback to return the cancellation result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders).
Cancels all reminders set by the current application. This API uses a promise to return the cancellation result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders-1).
Adds a notification slot. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot).
Adds a notification slot. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot-1).
Removes a notification slot of a specified type. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot).
Removes a notification slot of a specified type. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot-1).
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ActionButtonType](js-apis-reminderAgentManager.md#ActionButtonType).
| ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.|
## ReminderType
## ReminderType<sup>(deprecated)</sup>
Enumerates reminder types.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderType](js-apis-reminderAgentManager.md#ReminderType).
Defines a button displayed in the reminder notification.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ActionButton](js-apis-reminderAgentManager.md#ActionButton).
@@ -447,10 +507,14 @@ Defines a button displayed in the reminder notification.
| type | [ActionButtonType](#actionbuttontype) | Yes| Button type.|
## WantAgent
## WantAgent<sup>(deprecated)</sup>
Sets the package and ability that are redirected to when the reminder notification is clicked.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.WantAgent](js-apis-reminderAgentManager.md#WantAgent).
@@ -459,10 +523,14 @@ Sets the package and ability that are redirected to when the reminder notificati
| abilityName | string | Yes| Name of the ability that is redirected to when the reminder notification is clicked.|
## MaxScreenWantAgent
## MaxScreenWantAgent<sup>(deprecated)</sup>
Provides the information about the target package and ability to start automatically when the reminder is displayed in full-screen mode. This API is reserved.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.MaxScreenWantAgent](js-apis-reminderAgentManager.md#MaxScreenWantAgent).
@@ -471,10 +539,14 @@ Provides the information about the target package and ability to start automatic
| abilityName | string | Yes| Name of the ability that is automatically started when the reminder arrives and the device is not in use.|
## ReminderRequest
## ReminderRequest<sup>(deprecated)</sup>
Defines the reminder to publish.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequest](js-apis-reminderAgentManager.md#ReminderRequest).
@@ -494,12 +566,16 @@ Defines the reminder to publish.
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | No| Type of the slot used by the reminder.|
## ReminderRequestCalendar
## ReminderRequestCalendar<sup>(deprecated)</sup>
ReminderRequestCalendar extends ReminderRequest
Defines a reminder for a calendar event.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestCalendar](js-apis-reminderAgentManager.md#ReminderRequestCalendar).
@@ -509,12 +585,16 @@ Defines a reminder for a calendar event.
| repeatDays | Array\<number\> | No| Date on which the reminder repeats.|
## ReminderRequestAlarm
## ReminderRequestAlarm<sup>(deprecated)</sup>
ReminderRequestAlarm extends ReminderRequest
Defines a reminder for an alarm.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestAlarm](js-apis-reminderAgentManager.md#ReminderRequestAlarm).
@@ -524,12 +604,16 @@ Defines a reminder for an alarm.
| daysOfWeek | Array\<number\> | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.|
## ReminderRequestTimer
## ReminderRequestTimer<sup>(deprecated)</sup>
ReminderRequestTimer extends ReminderRequest
Defines a reminder for a scheduled timer.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestTimer](js-apis-reminderAgentManager.md#ReminderRequestTimer).
@@ -537,10 +621,14 @@ Defines a reminder for a scheduled timer.
| triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.|
## LocalDateTime
## LocalDateTime<sup>(deprecated)</sup>
Sets the time information for a calendar reminder.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.LocalDateTime](js-apis-reminderAgentManager.md#LocalDateTime).
Publishes a reminder through the reminder agent. This API uses an asynchronous callback to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8).
...
...
@@ -33,7 +31,7 @@ Publishes a reminder through the reminder agent. This API uses an asynchronous c
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.|
| callback | AsyncCallback\<number\> | Yes| Callback used to return the published reminder's ID.|
| callback | AsyncCallback\<number> | Yes| Callback used to return the published reminder's ID.|
Publishes a reminder through the reminder agent. This API uses a promise to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8).
...
...
@@ -85,7 +81,7 @@ Publishes a reminder through the reminder agent. This API uses a promise to retu
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<number\> | Promise used to return the published reminder's ID.|
| Promise\<number> | Promise used to return the published reminder's ID.|
Obtains all valid (not yet expired) reminders set by the current application. This API uses an asynchronous callback to return the reminders.
...
...
@@ -218,7 +208,7 @@ Obtains all valid (not yet expired) reminders set by the current application. Th
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<Array\<[ReminderRequest](#reminderrequest)\>\> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.|
| callback | AsyncCallback\<Array\<[ReminderRequest](#reminderrequest)>> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.|
Removes a notification slot of a specified type. This API uses a promise to return the result.
...
...
@@ -542,7 +518,7 @@ Removes a notification slot of a specified type. This API uses a promise to retu
| Type| Description|
| -------- | -------- |
| Promise\<void\> | Promise used to return the result.|
| Promise\<void> | Promise used to return the result.|
**Example**
...
...
@@ -570,7 +546,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_CUSTOM<sup>10+</sup> | 2 | Custom button. (This is a system API.)|
| ACTION_BUTTON_TYPE_CUSTOM<sup>10+</sup> | 2 | Custom button.<br>**System API**: This is a system API and cannot be called by third-party applications.|
## ReminderType
...
...
@@ -590,13 +566,14 @@ Enumerates reminder types.
Defines a button displayed for the reminder in the notification panel.
| type | [ActionButtonType](#actionbuttontype) | Yes| Button type.|
| wantAgent<sup>10+</sup> | [WantAgent](#wantagent) | No| Ability information that is displayed after the button is clicked. (This is a system API.)|
| wantAgent<sup>10+</sup> | [WantAgent](#wantagent) | No| Ability information that is displayed after the button is clicked.<br>**System API**: This is a system API and cannot be called by third-party applications.|
## WantAgent
...
...
@@ -605,10 +582,12 @@ Defines the information about the redirected-to ability.
| pkgName | string | Yes| Name of the target package.|
| abilityName | string | Yes| Name of the target ability.|
| uri<sup>10+</sup> | string | No| URI of the target ability.<br>**System API**: This is a system API and cannot be called by third-party applications.|
## MaxScreenWantAgent
...
...
@@ -632,7 +611,7 @@ Defines the reminder to publish.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reminderType | [ReminderType](#remindertype) | Yes| Type of the reminder.|
| 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. |
| actionButton<sup>10+</sup> | [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**.|
...
...
@@ -659,8 +638,8 @@ Defines a reminder for a calendar event.
| repeatMonths | Array\<number\> | No| Month in which the reminder repeats.|
| repeatDays | Array\<number\> | No| Date on which the reminder repeats.|
| repeatMonths | Array\<number> | No| Month in which the reminder repeats.|
| repeatDays | Array\<number> | No| Date on which the reminder repeats.|
## ReminderRequestAlarm
...
...
@@ -675,7 +654,7 @@ Defines a reminder for an alarm.
| -------- | -------- | -------- | -------- |
| hour | number | Yes| Hour portion of the reminder time.|
| minute | number | Yes| Minute portion of the reminder time.|
| daysOfWeek | Array\<number\> | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.|
| daysOfWeek | Array\<number> | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.|
The reminder agent allows you to customize buttons for system applications. Clicking a custom button will redirect you to the specified application page.
**Change Impact**
For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set custom buttons for reminders.