You need to sign in or sign up before continuing.
js-apis-reminderAgent.md 17.7 KB
Newer Older
E
ester.zhou 已提交
1
# Reminder Agent
Z
zengyawen 已提交
2

E
ester.zhou 已提交
3 4
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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.
Z
zengyawen 已提交
5 6


E
ester.zhou 已提交
7
## Modules to Import
Z
zengyawen 已提交
8 9

```
E
ester.zhou 已提交
10
import reminderAgent from'@ohos.reminderAgent';
Z
zengyawen 已提交
11 12
```

E
ester.zhou 已提交
13 14 15 16 17 18 19

## reminderAgent.publishReminder

publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void

Publishes an agent-powered reminder. This API uses an asynchronous callback to return the result.

E
ester.zhou 已提交
20
**Required permissions**: ohos.permission.PUBLISH_AGENT_REMINDER
E
ester.zhou 已提交
21

E
ester.zhou 已提交
22 23 24
**System capability**: SystemCapability.Notification.ReminderAgent

**Parameters**
E
ester.zhou 已提交
25 26 27 28 29 30

  | Name| Type| Mandatory| Description|
  | -------- | -------- | -------- | -------- |
  | reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.|
  | callback | AsyncCallback<number> | Yes| Asynchronous callback used to return the published reminder's ID.|

E
ester.zhou 已提交
31
**Example**
E
ester.zhou 已提交
32
  ```
R
rcy-hw 已提交
33 34 35
  let timer : reminderAgent.ReminderRequestTimer = {
      reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
      triggerTimeInSeconds: 10
E
ester.zhou 已提交
36
  }
R
rcy-hw 已提交
37 38 39
  reminderAgent.publishReminder(timer, (err, reminderId) => {
      console.log("reminderId = " + reminderId);
  });
E
ester.zhou 已提交
40 41 42 43 44 45 46 47 48
  ```


## reminderAgent.publishReminder

publishReminder(reminderReq: ReminderRequest): Promise<number>

Publishes an agent-powered reminder. This API uses a promise callback to return the result.

E
ester.zhou 已提交
49
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
50

E
ester.zhou 已提交
51
**Parameters**
E
ester.zhou 已提交
52 53 54 55
  | Name| Type| Mandatory| Description|
  | -------- | -------- | -------- | -------- |
  | reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.|

E
ester.zhou 已提交
56
**Return value**
E
ester.zhou 已提交
57 58 59 60
  | Type| Description|
  | -------- | -------- |
  | Promise<number> | Promise used to return the published reminder's ID.|

E
ester.zhou 已提交
61
**Example**
E
ester.zhou 已提交
62
  ```
R
rcy-hw 已提交
63 64 65
  let timer : reminderAgent.ReminderRequestTimer = {
      reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
      triggerTimeInSeconds: 10
E
ester.zhou 已提交
66
  }
R
rcy-hw 已提交
67 68 69
  reminderAgent.publishReminder(timer).then((reminderId) => {
      console.log("reminderId = " + reminderId);
  });
E
ester.zhou 已提交
70 71 72 73 74 75 76 77 78
  ```


## reminderAgent.cancelReminder

cancelReminder(reminderId: number, callback: AsyncCallback<void>): void

Cancels the reminder with the specified ID. This API uses an asynchronous callback to return the cancellation result.

E
ester.zhou 已提交
79
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
80

E
ester.zhou 已提交
81
**Parameters**
E
ester.zhou 已提交
82 83 84 85 86 87

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reminderId | number | Yes| ID of the reminder to cancel.|
| callback | AsyncCallback<void> | Yes| Asynchronous callback used to return the result.|

E
ester.zhou 已提交
88
**Example**
Z
zengyawen 已提交
89 90

```
R
rcy-hw 已提交
91 92 93
reminderAgent.cancelReminder(1, (err, data) => {
    console.log("cancelReminder callback");
});
Z
zengyawen 已提交
94 95
```

E
ester.zhou 已提交
96 97 98 99 100 101 102

## reminderAgent.cancelReminder

cancelReminder(reminderId: number): Promise<void>

Cancels the reminder with the specified ID. This API uses a promise to return the cancellation result.

E
ester.zhou 已提交
103
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
104

E
ester.zhou 已提交
105
**Parameters**
E
ester.zhou 已提交
106 107 108 109 110

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reminderId | number | Yes| ID of the reminder to cancel.|

E
ester.zhou 已提交
111
**Return value**
E
ester.zhou 已提交
112 113 114 115 116

| Type| Description|
| -------- | -------- |
| Promise<void> | Promise used to return the result.|

E
ester.zhou 已提交
117
**Example**
Z
zengyawen 已提交
118 119

```
R
rcy-hw 已提交
120 121 122
reminderAgent.cancelReminder(1).then(() => {
    console.log("cancelReminder promise");
});
Z
zengyawen 已提交
123 124
```

E
ester.zhou 已提交
125 126 127 128 129 130 131

## reminderAgent.getValidReminders

getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void

Obtains all valid (not yet expired) reminders set by the current application. This API uses an asynchronous callback to return the reminders.

E
ester.zhou 已提交
132
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
133

E
ester.zhou 已提交
134
**Parameters**
E
ester.zhou 已提交
135 136 137 138 139

| 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.|

E
ester.zhou 已提交
140
**Example**
Z
zengyawen 已提交
141 142 143

```
reminderAgent.getValidReminders((err, reminders) => {
R
rcy-hw 已提交
144
    console.log("getValidReminders length = " + reminders.length);
Z
zengyawen 已提交
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
    for (let i = 0; i < reminders.length; i++) {
        console.log("getValidReminders = " + reminders[i]);
        console.log("getValidReminders, reminderType = " + reminders[i].reminderType);
        for (let j = 0; j < reminders[i].actionButton.length; j++) {
            console.log("getValidReminders, actionButton.title = " + reminders[i].actionButton[j].title);
            console.log("getValidReminders, actionButton.type = " + reminders[i].actionButton[j].type);
        }
        console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent.pkgName);
        console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent.abilityName);
        console.log("getValidReminders, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent.pkgName);
        console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent.abilityName);
        console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
        console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
        console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
        console.log("getValidReminders, title = " + reminders[i].title);
        console.log("getValidReminders, content = " + reminders[i].content);
        console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
        console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
        console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
        console.log("getValidReminders, slotType = " + reminders[i].slotType);
    }
})
```


E
ester.zhou 已提交
170 171 172 173 174
## reminderAgent.getValidReminders

getValidReminders(): Promise&lt;Array&lt;ReminderRequest&gt;&gt;

Obtains all valid (not yet expired) reminders set by the current application. This API uses a promise to return the reminders.
Z
zengyawen 已提交
175

E
ester.zhou 已提交
176
**System capability**: SystemCapability.Notification.ReminderAgent
Z
zengyawen 已提交
177

E
ester.zhou 已提交
178
**Return value**
Z
zengyawen 已提交
179

E
ester.zhou 已提交
180 181 182 183
| Type| Description|
| -------- | -------- |
| Promise&lt;Array&lt;[ReminderRequest](#reminderrequest)&gt;&gt; | Promise used to return an array of all valid reminders set by the current application.|

E
ester.zhou 已提交
184
**Example**
Z
zengyawen 已提交
185 186

```
E
ester.zhou 已提交
187
reminderAgent.getValidReminders().then((reminders) => {
R
rcy-hw 已提交
188
    console.log("getValidReminders length = " + reminders.length);
Z
zengyawen 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
    for (let i = 0; i < reminders.length; i++) {
        console.log("getValidReminders = " + reminders[i]);
        console.log("getValidReminders, reminderType = " + reminders[i].reminderType);
        for (let j = 0; j < reminders[i].actionButton.length; j++) {
            console.log("getValidReminders, actionButton.title = " + reminders[i].actionButton[j].title);
            console.log("getValidReminders, actionButton.type = " + reminders[i].actionButton[j].type);
        }
        console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent.pkgName);
        console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent.abilityName);
        console.log("getValidReminders, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent.pkgName);
        console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent.abilityName);
        console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
        console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
        console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
        console.log("getValidReminders, title = " + reminders[i].title);
        console.log("getValidReminders, content = " + reminders[i].content);
        console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
        console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
        console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
        console.log("getValidReminders, slotType = " + reminders[i].slotType);
    }
})
```

E
ester.zhou 已提交
213 214 215 216 217 218 219

## reminderAgent.cancelAllReminders

cancelAllReminders(callback: AsyncCallback&lt;void&gt;): void

Cancels all reminders set by the current application. This API uses an asynchronous callback to return the cancellation result.

E
ester.zhou 已提交
220
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
221

E
ester.zhou 已提交
222
**Parameters**
E
ester.zhou 已提交
223 224 225 226 227

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | Yes| Asynchronous callback used to return the result.|

E
ester.zhou 已提交
228
**Example**
Z
zengyawen 已提交
229 230

```
E
ester.zhou 已提交
231
reminderAgent.cancelAllReminders((err, data) =>{
R
rcy-hw 已提交
232 233
    console.log("cancelAllReminders callback")
})
Z
zengyawen 已提交
234 235 236
```


E
ester.zhou 已提交
237
## reminderAgent.cancelAllReminders
Z
zengyawen 已提交
238

E
ester.zhou 已提交
239
cancelAllReminders(): Promise&lt;void&gt;
Z
zengyawen 已提交
240

E
ester.zhou 已提交
241
Cancels all reminders set by the current application. This API uses a promise to return the cancellation result.
Z
zengyawen 已提交
242

E
ester.zhou 已提交
243
**System capability**: SystemCapability.Notification.ReminderAgent
Z
zengyawen 已提交
244

E
ester.zhou 已提交
245
**Return value**
E
ester.zhou 已提交
246 247 248 249 250

| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|

E
ester.zhou 已提交
251
**Example**
Z
zengyawen 已提交
252 253 254

```
reminderAgent.cancelAllReminders().then(() => {
R
rcy-hw 已提交
255 256
    console.log("cancelAllReminders promise")
})
Z
zengyawen 已提交
257 258
```

E
ester.zhou 已提交
259 260 261 262 263 264 265

## reminderAgent.addNotificationSlot

addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback&lt;void&gt;): void

Adds a reminder notification slot. This API uses an asynchronous callback to return the result.

E
ester.zhou 已提交
266
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
267

E
ester.zhou 已提交
268
**Parameters**
E
ester.zhou 已提交
269 270 271 272 273 274

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Reminder notification slot to add.|
| callback | AsyncCallback&lt;void&gt; | Yes| Asynchronous callback used to return the result.|

E
ester.zhou 已提交
275
**Example**
Z
zengyawen 已提交
276 277

```
R
rcy-hw 已提交
278 279 280
mySlot: {
    type: 3,
    sound: "/sdcard/music2.mp3"
Z
zengyawen 已提交
281
}
R
rcy-hw 已提交
282
reminderAgent.addNotificationSlot(mySlot, (err, data) => {
R
rcy-hw 已提交
283 284
    console.log("addNotificationSlot callback");
});
Z
zengyawen 已提交
285 286
```

E
ester.zhou 已提交
287 288 289 290 291 292 293

## reminderAgent.addNotificationSlot

addNotificationSlot(slot: NotificationSlot): Promise&lt;void&gt;

Adds a reminder notification slot. This API uses a promise to return the result.

E
ester.zhou 已提交
294
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
295

E
ester.zhou 已提交
296
**Parameters**
E
ester.zhou 已提交
297 298 299 300 301

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Reminder notification slot to add.|

E
ester.zhou 已提交
302
**Return value**
E
ester.zhou 已提交
303 304 305 306 307

| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|

E
ester.zhou 已提交
308
**Example**
Z
zengyawen 已提交
309 310

```
E
ester.zhou 已提交
311
export default {    data: {        mySlot: {
Z
zengyawen 已提交
312 313
            type: 3,
            sound: "/sdcard/music2.mp3"
E
ester.zhou 已提交
314
        }    },
Z
zengyawen 已提交
315
    addSlot() {
R
rcy-hw 已提交
316
        reminderAgent.addNotificationSlot(mySlot).then(() => {
E
ester.zhou 已提交
317
   console.log("do next");
Z
zengyawen 已提交
318 319 320 321 322
        });
    }
}
```

E
ester.zhou 已提交
323 324 325 326 327 328 329

## reminderAgent.removeNotificationSlot

removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback&lt;void&gt;): void

Removes a notification slot of a specified type. This API uses an asynchronous callback to return the result.

E
ester.zhou 已提交
330
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
331

E
ester.zhou 已提交
332
**Parameters**
E
ester.zhou 已提交
333 334 335 336 337 338

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | Yes| Type of the reminder notification slot to remove.|
| callback | AsyncCallback&lt;void&gt; | Yes| Asynchronous callback used to return the result.|

E
ester.zhou 已提交
339
**Example**
Z
zengyawen 已提交
340 341

```
R
rcy-hw 已提交
342 343
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => {
    console.log("removeNotificationSlot callback");
E
ester.zhou 已提交
344
});
Z
zengyawen 已提交
345 346
```

E
ester.zhou 已提交
347 348 349 350 351 352 353

## reminderAgent.removeNotificationSlot

removeNotificationSlot(slotType: notification.SlotType): Promise&lt;void&gt;

Removes a notification slot of a specified type. This API uses a promise to return the result.

E
ester.zhou 已提交
354
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
355

E
ester.zhou 已提交
356
**Parameters**
E
ester.zhou 已提交
357 358 359 360 361

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | Yes| Type of the reminder notification slot to remove.|

E
ester.zhou 已提交
362
**Return value**
E
ester.zhou 已提交
363 364 365 366 367

| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | Promise used to return the result.|

E
ester.zhou 已提交
368
**Example**
Z
zengyawen 已提交
369 370

```
R
rcy-hw 已提交
371 372 373
reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
    console.log("removeNotificationSlot promise");
});
Z
zengyawen 已提交
374 375
```

E
ester.zhou 已提交
376 377

## ActionButtonType
Z
zengyawen 已提交
378 379 380

Enumerates button types.

E
ester.zhou 已提交
381
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
382 383 384 385 386 387 388 389

| Name| Default Value| Description|
| -------- | -------- | -------- |
| ACTION_BUTTON_TYPE_CLOSE | 0 | Button for closing the reminder.|
| ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.|


## ReminderType
Z
zengyawen 已提交
390 391 392

Enumerates reminder types.

E
ester.zhou 已提交
393
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
394 395 396 397 398 399 400 401 402

| Name| Default Value| Description|
| -------- | -------- | -------- |
| REMINDER_TYPE_TIMER | 0 | Countdown reminder.|
| REMINDER_TYPE_CALENDAR | 1 | Calendar reminder.|
| REMINDER_TYPE_ALARM | 2 | Alarm reminder.|


## ActionButton
Z
zengyawen 已提交
403 404 405

Defines a button displayed in the reminder notification.

E
ester.zhou 已提交
406
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
407 408 409 410 411 412 413 414

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| title | string | Yes| Text on the button.|
| type | [ActionButtonType](#actionbuttontype) | Yes| Button type.|


## WantAgent
Z
zengyawen 已提交
415 416 417

Sets the package and ability that are redirected to when the reminder notification is clicked.

E
ester.zhou 已提交
418
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
419 420 421 422 423 424 425 426

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| pkgName | string | Yes| Name of the package 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
Z
zengyawen 已提交
427 428 429

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.

E
ester.zhou 已提交
430
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
431 432 433 434 435 436 437 438

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| 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.|


## ReminderRequest
Z
zengyawen 已提交
439 440 441

Defines the reminder to publish.

E
ester.zhou 已提交
442
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| reminderType | ReminderType | Yes| Type of the reminder.|
| actionButton | [ActionButton?,&nbsp;ActionButton?] | No| Action button displayed in the reminder notification. (The parameter is optional. Up to two buttons are supported.)|
| 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.|
| ringDuration | number | No| Ringing duration.|
| snoozeTimes | number | No| Number of reminder snooze times.|
| timeInterval | number | No| Reminder snooze interval.|
| 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.|


## ReminderRequestCalendar
Z
zengyawen 已提交
462 463 464 465 466

ReminderRequestCalendar extends ReminderRequest

Defines a reminder for a calendar event.

E
ester.zhou 已提交
467
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
468 469 470 471 472 473 474 475 476

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| dateTime | [LocalDateTime](#localdatetime) | Yes| Reminder time.|
| repeatMonths | Array&lt;number&gt; | No| Month in which the reminder repeats.|
| repeatDays | Array&lt;number&gt; | No| Date on which the reminder repeats.|


## ReminderRequestAlarm
Z
zengyawen 已提交
477 478 479

ReminderRequestAlarm extends ReminderRequest

E
ester.zhou 已提交
480 481
Defines a reminder for an alarm.

E
ester.zhou 已提交
482
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
483

E
ester.zhou 已提交
484
| Name| Type| Mandatory| Description|
E
ester.zhou 已提交
485 486 487 488 489 490 491 492 493
| -------- | -------- | -------- | -------- |
| hour | number | Yes| Hour portion of the reminder time.|
| minute | number | Yes| Minute portion of the reminder time.|
| daysOfWeek | Array&lt;number&gt; | No| Days of a week when the reminder repeats.|


## ReminderRequestTimer

ReminderRequestTimer extends ReminderRequest
Z
zengyawen 已提交
494 495 496

Defines a reminder for a scheduled timer.

E
ester.zhou 已提交
497
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
498 499 500 501 502 503 504

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.|


## LocalDateTime
Z
zengyawen 已提交
505 506 507

Sets the time information for a calendar reminder.

E
ester.zhou 已提交
508
**System capability**: SystemCapability.Notification.ReminderAgent
E
ester.zhou 已提交
509 510 511 512 513 514 515 516 517

| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| year | number | Yes| Year.|
| month | number | Yes| Month.|
| day | number | Yes| Date.|
| hour | number | Yes| Hour.|
| minute | number | Yes| Minute.|
| second | number | No| Second.|