>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import<a name="s56d19203690d4782bfc74069abb6bd71"></a>
Publishes an agent-powered reminder. This API uses a promise callback to return the result.
<td class="cellrowborder" valign="top" width="52.260000000000005%" headers="mcps1.1.5.1.4 "><p id="p12534335162410"><a name="p12534335162410"></a><a name="p12534335162410"></a>Asynchronous callback used to return the result.</p>
</td>
- System capability
</tr>
</tbody>
SystemCapability.Notification.ReminderAgent
</table>
- Parameters
- Example
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
```
| reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.|
<td class="cellrowborder" valign="top" width="83.50999999999999%" headers="mcps1.1.3.1.2 "><p id="p3453185521713"><a name="p3453185521713"></a><a name="p3453185521713"></a>Promise used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p8526323195"><aname="p8526323195"></a><aname="p8526323195"></a>ID of the reminder to cancel.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p10241193191015"><aname="p10241193191015"></a><aname="p10241193191015"></a>Asynchronous callback used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p15521284588"><aname="p15521284588"></a><aname="p15521284588"></a>ID of the reminder to cancel.</p>
<tdclass="cellrowborder"valign="top"width="83.50999999999999%"headers="mcps1.1.3.1.2 "><pid="p9638101412116"><aname="p9638101412116"></a><aname="p9638101412116"></a>Promise used to return the result.</p>
| callback | AsyncCallback<Array<[ReminderRequest](#reminderrequest)>> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.|
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p9450122531318"><aname="p9450122531318"></a><aname="p9450122531318"></a>Asynchronous callback used to return an array of all valid reminders set by the current application.</p>
<tdclass="cellrowborder"valign="top"width="64.58%"headers="mcps1.1.3.1.2 "><pid="p5709101715414"><aname="p5709101715414"></a><aname="p5709101715414"></a>Promise used to return an array of all valid reminders set by the current application.</p>
</td>
</tr>
</tbody>
</table>
- Example
| Type| Description|
| -------- | -------- |
| Promise<Array<[ReminderRequest](#reminderrequest)>> | Promise used to return an array of all valid reminders set by the current application.|
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p13748123131616"><aname="p13748123131616"></a><aname="p13748123131616"></a>Asynchronous callback used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="83.50999999999999%"headers="mcps1.1.3.1.2 "><pid="p10909141313310"><aname="p10909141313310"></a><aname="p10909141313310"></a>Promise used to return the result.</p>
</td>
</tr>
</tbody>
</table>
- Example
SystemCapability.Notification.ReminderAgent
- Return value
| Type| Description|
| -------- | -------- |
| Promise<void> | Promise used to return the result.|
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p9553101593"><aname="p9553101593"></a><aname="p9553101593"></a>Asynchronous callback used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="83.50999999999999%"headers="mcps1.1.3.1.2 "><pid="p69521686215"><aname="p69521686215"></a><aname="p69521686215"></a>Promise used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p38371711181913"><aname="p38371711181913"></a><aname="p38371711181913"></a>Type of the reminder notification slot to remove.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p13632804203"><aname="p13632804203"></a><aname="p13632804203"></a>Asynchronous callback used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p72081335131013"><aname="p72081335131013"></a><aname="p72081335131013"></a>Type of the reminder notification slot to remove.</p>
<tdclass="cellrowborder"valign="top"width="83.50999999999999%"headers="mcps1.1.3.1.2 "><pid="p159379302215"><aname="p159379302215"></a><aname="p159379302215"></a>Promise used to return the result.</p>
<tdclass="cellrowborder"valign="top"width="59.67%"headers="mcps1.1.4.1.3 "><pid="p328012293211"><aname="p328012293211"></a><aname="p328012293211"></a>Button for closing the reminder.</p>
<tdclass="cellrowborder"valign="top"width="59.67%"headers="mcps1.1.4.1.3 "><pid="p15865395215"><aname="p15865395215"></a><aname="p15865395215"></a>Button for snoozing the reminder.</p>
<tdclass="cellrowborder"valign="top"width="59.245924592459254%"headers="mcps1.1.5.1.4 "><pid="p109351224253"><aname="p109351224253"></a><aname="p109351224253"></a>Text on the button.</p>
<tdclass="cellrowborder"valign="top"width="42.94%"headers="mcps1.1.5.1.4 "><pid="p11032371372"><aname="p11032371372"></a><aname="p11032371372"></a>Name of the package redirected to when the reminder notification is clicked.</p>
<tdclass="cellrowborder"valign="top"width="42.94%"headers="mcps1.1.5.1.4 "><pid="p110323723719"><aname="p110323723719"></a><aname="p110323723719"></a>Name of the ability that is redirected to when the reminder notification is clicked.</p>
Sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed.
Sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed.
<tdclass="cellrowborder"valign="top"width="52.56999999999999%"headers="mcps1.1.5.1.4 "><pid="p06713419449"><aname="p06713419449"></a><aname="p06713419449"></a>Name of the package that is automatically started when the reminder arrives and the device is not in use.</p>
<tdclass="cellrowborder"valign="top"width="52.56999999999999%"headers="mcps1.1.5.1.4 "><pid="p1067124114413"><aname="p1067124114413"></a><aname="p1067124114413"></a>Name of the ability that is automatically started when the reminder arrives and the device is not in use.</p>
| actionButton | [ActionButton?, ActionButton?] | No| Action button displayed in the reminder notification. (The parameter is optional. Up to two buttons are supported.)|
</th>
| wantAgent | WantAgent | No| Information about the ability that is redirected to when the notification is clicked.|
| 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.|
</th>
| ringDuration | number | No| Ringing duration.|
</tr>
| snoozeTimes | number | No| Number of reminder snooze times.|
</thead>
| timeInterval | number | No| Reminder snooze interval.|
| 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.|
</td>
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | No| Type of the slot used by the reminder.|
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p189097154319"><aname="p189097154319"></a><aname="p189097154319"></a>Type of the reminder.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p290916157310"><aname="p290916157310"></a><aname="p290916157310"></a>Action button displayed in the reminder notification. (The parameter is optional. Up to two buttons are supported.)</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p39099154310"><aname="p39099154310"></a><aname="p39099154310"></a>Information about the ability that is redirected to when the notification is clicked.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p1590971511318"><aname="p1590971511318"></a><aname="p1590971511318"></a>Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p1133019297412"><aname="p1133019297412"></a><aname="p1133019297412"></a>Content to be displayed after the reminder expires.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p144369238411"><aname="p144369238411"></a><aname="p144369238411"></a>Content to be displayed when the reminder is snoozing.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p1408226147"><aname="p1408226147"></a><aname="p1408226147"></a>Notification ID used by the reminder. If there are reminders with the same notification ID, the later one will overwrite the earlier one.</p>
<tdclass="cellrowborder"valign="top"width="34.79%"headers="mcps1.1.5.1.4 "><pid="p38051918641"><aname="p38051918641"></a><aname="p38051918641"></a>Type of the slot used by the reminder.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p1949464352118"><aname="p1949464352118"></a><aname="p1949464352118"></a>Month in which the reminder repeats.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p18494164317214"><aname="p18494164317214"></a><aname="p18494164317214"></a>Date on which the reminder repeats.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p654235218243"><aname="p654235218243"></a><aname="p654235218243"></a>Hour portion of the reminder time.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p1254265213248"><aname="p1254265213248"></a><aname="p1254265213248"></a>Minute portion of the reminder time.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p125422524244"><aname="p125422524244"></a><aname="p125422524244"></a>Days of a week when the reminder repeats.</p>
<tdclass="cellrowborder"valign="top"width="25%"headers="mcps1.1.5.1.4 "><pid="p7416133915270"><aname="p7416133915270"></a><aname="p7416133915270"></a>Number of seconds in the countdown timer.</p>