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).
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.|
| ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.|
## ReminderType
## ReminderType<sup>(deprecated)</sup>
Enumerates reminder types.
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.
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.
...
@@ -447,10 +507,14 @@ Defines a button displayed in the reminder notification.
| type | [ActionButtonType](#actionbuttontype) | Yes| Button type.|
| 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.
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
...
@@ -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.|
| 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.
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
...
@@ -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.|
| 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.
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.
...
@@ -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.|
| 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
ReminderRequestCalendar extends ReminderRequest
Defines a reminder for a calendar event.
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.
...
@@ -509,12 +585,16 @@ Defines a reminder for a calendar event.
| repeatDays | Array\<number\> | No| Date on which the reminder repeats.|
| repeatDays | Array\<number\> | No| Date on which the reminder repeats.|
## ReminderRequestAlarm
## ReminderRequestAlarm<sup>(deprecated)</sup>
ReminderRequestAlarm extends ReminderRequest
ReminderRequestAlarm extends ReminderRequest
Defines a reminder for an alarm.
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.
...
@@ -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.|
| 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
ReminderRequestTimer extends ReminderRequest
Defines a reminder for a scheduled timer.
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.
...
@@ -537,10 +621,14 @@ Defines a reminder for a scheduled timer.
| triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.|
| triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.|
## LocalDateTime
## LocalDateTime<sup>(deprecated)</sup>
Sets the time information for a calendar reminder.
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).
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
...
@@ -33,7 +31,7 @@ Publishes a reminder through the reminder agent. This API uses an asynchronous c
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.|
| 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).
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
...
@@ -85,7 +81,7 @@ Publishes a reminder through the reminder agent. This API uses a promise to retu
**Return value**
**Return value**
| Type| Description|
| 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.
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
...
@@ -218,7 +208,7 @@ Obtains all valid (not yet expired) reminders set by the current application. Th
| Name| Type| Mandatory| Description|
| 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.
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
...
@@ -542,7 +518,7 @@ Removes a notification slot of a specified type. This API uses a promise to retu
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise\<void\> | Promise used to return the result.|
| Promise\<void> | Promise used to return the result.|
**Example**
**Example**
...
@@ -570,7 +546,7 @@ Enumerates button types.
...
@@ -570,7 +546,7 @@ Enumerates button types.
| -------- | -------- | -------- |
| -------- | -------- | -------- |
| ACTION_BUTTON_TYPE_CLOSE | 0 | Button for closing the reminder.|
| ACTION_BUTTON_TYPE_CLOSE | 0 | Button for closing the reminder.|
| ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing 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
## ReminderType
...
@@ -590,13 +566,14 @@ Enumerates reminder types.
...
@@ -590,13 +566,14 @@ Enumerates reminder types.
Defines a button displayed for the reminder in the notification panel.
Defines a button displayed for the reminder in the notification panel.
| type | [ActionButtonType](#actionbuttontype) | Yes| Button type.|
| 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
## WantAgent
...
@@ -605,10 +582,12 @@ Defines the information about the redirected-to ability.
...
@@ -605,10 +582,12 @@ Defines the information about the redirected-to ability.
| pkgName | string | Yes| Name of the target package.|
| pkgName | string | Yes| Name of the target package.|
| abilityName | string | Yes| Name of the target ability.|
| 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
## MaxScreenWantAgent
...
@@ -632,7 +611,7 @@ Defines the reminder to publish.
...
@@ -632,7 +611,7 @@ Defines the reminder to publish.
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderType | [ReminderType](#remindertype) | Yes| Type of the reminder.|
| 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.|
| 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.|
| 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**.|
| ringDuration | number | No| Ringing duration, in seconds. The default value is **1**.|
...
@@ -659,8 +638,8 @@ Defines a reminder for a calendar event.
...
@@ -659,8 +638,8 @@ Defines a reminder for a calendar event.
| repeatMonths | Array\<number\> | No| Month in which the reminder repeats.|
| repeatMonths | Array\<number> | No| Month in which the reminder repeats.|
| repeatDays | Array\<number\> | No| Date on which the reminder repeats.|
| repeatDays | Array\<number> | No| Date on which the reminder repeats.|
## ReminderRequestAlarm
## ReminderRequestAlarm
...
@@ -675,7 +654,7 @@ Defines a reminder for an alarm.
...
@@ -675,7 +654,7 @@ Defines a reminder for an alarm.
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| hour | number | Yes| Hour portion of the reminder time.|
| hour | number | Yes| Hour portion of the reminder time.|
| minute | number | Yes| Minute 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.