You need to sign in or sign up before continuing.
js-apis-reminderAgent.md 17.5 KB
Newer Older
S
s00567680 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# 后台代理提醒

> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。


## 导入模块

```
import reminderAgent from'@ohos.reminderAgent';
```


## reminderAgent.publishReminder

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

发布一个后台代理提醒,使用callback方式实现异步调用。

R
rcy-hw 已提交
20 21
**需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER

R
RayShih 已提交
22
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
23

R
RayShih 已提交
24
**参数**
X
xuezhongzhu 已提交
25 26

  | 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
27
  | -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
28 29
  | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 |
  | callback | AsyncCallback<number> | 是 | 异步回调,返回当前发布的提醒的reminderId。 |
S
s00567680 已提交
30

R
RayShih 已提交
31
**示例**
S
s00567680 已提交
32
  ```
R
RayShih 已提交
33 34 35
  export default {
      data: {
          timer: {
S
s00567680 已提交
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
              reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
              triggerTimeInSeconds: 3
          }
      },
      startTimer() {
          reminderAgent.publishReminder(timer, (err, reminderId) => {    console.log("reminderId = " + reminderId);
          });
      }
  }
  ```


## reminderAgent.publishReminder

publishReminder(reminderReq: ReminderRequest): Promise<number>

发布一个后台代理提醒,使用Promise方式实现异步调用。

R
RayShih 已提交
54
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
55

R
RayShih 已提交
56
**参数**
X
xuezhongzhu 已提交
57
  | 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
58
  | -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
59
  | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 |
S
s00567680 已提交
60

R
RayShih 已提交
61
**返回值**
X
xuezhongzhu 已提交
62
  | 类型 | 说明 |
S
s00567680 已提交
63
  | -------- | -------- |
X
xuezhongzhu 已提交
64
  | Promise<number> | 返回提醒的reminderId。 |
S
s00567680 已提交
65

R
RayShih 已提交
66
**示例**
S
s00567680 已提交
67
  ```
R
RayShih 已提交
68
  export default {
R
rcy-hw 已提交
69
      data:
R
RayShih 已提交
70
          {timer: {
S
s00567680 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
              reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
              triggerTimeInSeconds: 3
          }
      },
      startTimer() {
          reminderAgent.publishReminder(this.timer).then((reminderId) => {
              console.log("reminderId = " + reminderId);
          });
      }
  }
  ```


## reminderAgent.cancelReminder

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

取消指定id的提醒,使用callback方式实现异步调用。

R
RayShih 已提交
90
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
91

R
RayShih 已提交
92
**参数**
S
s00567680 已提交
93

X
xuezhongzhu 已提交
94
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
95
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
96 97
| reminderId | number | 是 | 目标reminder的id号。 |
| callback | AsyncCallback<void> | 是 | 异步回调。 |
S
s00567680 已提交
98

R
RayShih 已提交
99
**示例**
S
s00567680 已提交
100 101 102

```
export default {
R
RayShih 已提交
103 104
    cancel() {
        reminderAgent.cancelReminder(1, (err, data) => {
S
s00567680 已提交
105 106 107 108 109 110 111 112 113 114 115 116 117
            console.log("do next");
        });
    }
}
```


## reminderAgent.cancelReminder

cancelReminder(reminderId: number): Promise<void>

取消指定id的提醒,使用Promise方式实现异步调用。

R
RayShih 已提交
118
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
119

R
RayShih 已提交
120
**参数**
S
s00567680 已提交
121

X
xuezhongzhu 已提交
122
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
123
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
124
| reminderId | number | 是 | 目标reminder的id号。 |
S
s00567680 已提交
125

R
RayShih 已提交
126
**返回值**
S
s00567680 已提交
127

X
xuezhongzhu 已提交
128
| 类型 | 说明 |
S
s00567680 已提交
129
| -------- | -------- |
X
xuezhongzhu 已提交
130
| Promise<void> | Promise类型异步回调。 |
S
s00567680 已提交
131

R
RayShih 已提交
132
**示例**
S
s00567680 已提交
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150

```
export default {
    cancel() {
        reminderAgent.cancelReminder(1).then(() => {
            console.log("do next");
        });
    }
}
```


## reminderAgent.getValidReminders

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

获取当前应用已设置的所有有效(未过期)的提醒,使用callback方式实现异步调用。

R
RayShih 已提交
151
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
152

R
RayShih 已提交
153
**参数**
S
s00567680 已提交
154

X
xuezhongzhu 已提交
155
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
156
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
157
| callback | AsyncCallback<Array<[ReminderRequest](#reminderrequest)>> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 |
S
s00567680 已提交
158

R
RayShih 已提交
159
**示例**
S
s00567680 已提交
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193

```
reminderAgent.getValidReminders((err, reminders) => {
    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);
    }
})
```


## reminderAgent.getValidReminders

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

获取当前应用已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用。

R
RayShih 已提交
194
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
195

R
RayShih 已提交
196
**返回值**
S
s00567680 已提交
197

X
xuezhongzhu 已提交
198
| 类型 | 说明 |
S
s00567680 已提交
199
| -------- | -------- |
X
xuezhongzhu 已提交
200
| Promise&lt;Array&lt;[ReminderRequest](#reminderrequest)&gt;&gt; | 返回当前应用已设置的所有有效(未过期)的提醒。 |
S
s00567680 已提交
201

R
RayShih 已提交
202
**示例**
S
s00567680 已提交
203 204

```
R
rcy-hw 已提交
205
reminderAgent.getValidReminders().then((reminders) => {
S
s00567680 已提交
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
    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);
    }
})
```


## reminderAgent.cancelAllReminders

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

取消当前应用所有的提醒,使用callback方式实现异步调用。

R
RayShih 已提交
237
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
238

R
RayShih 已提交
239
**参数**
S
s00567680 已提交
240

X
xuezhongzhu 已提交
241
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
242
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
243
| callback | AsyncCallback&lt;void&gt; | 是 | 异步回调。 |
S
s00567680 已提交
244

R
RayShih 已提交
245
**示例**
S
s00567680 已提交
246 247

```
R
rcy-hw 已提交
248
reminderAgent.cancelAllReminders((err, data) =>{
S
s00567680 已提交
249 250 251 252 253 254 255 256 257 258
    console.log("do next")})
```


## reminderAgent.cancelAllReminders

cancelAllReminders(): Promise&lt;void&gt;

取消当前应用所有的提醒,使用Promise方式实现异步调用。

R
RayShih 已提交
259
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
260

R
RayShih 已提交
261
**返回值**
S
s00567680 已提交
262

X
xuezhongzhu 已提交
263
| 类型 | 说明 |
S
s00567680 已提交
264
| -------- | -------- |
X
xuezhongzhu 已提交
265
| Promise&lt;void&gt; | Promise类型异步回调。 |
S
s00567680 已提交
266

R
RayShih 已提交
267
**示例**
S
s00567680 已提交
268 269 270 271 272 273 274 275 276 277 278 279 280

```
reminderAgent.cancelAllReminders().then(() => {
    console.log("do next")})
```


## reminderAgent.addNotificationSlot

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

添加一个NotificationSlot,使用callback方式实现异步调用。

R
RayShih 已提交
281
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
282

R
RayShih 已提交
283
**参数**
S
s00567680 已提交
284

X
xuezhongzhu 已提交
285
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
286
| -------- | -------- | -------- | -------- |
R
rcy-hw 已提交
287
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification&nbsp;slot实例。 |
X
xuezhongzhu 已提交
288
| callback | AsyncCallback&lt;void&gt; | 是 | 异步回调。 |
S
s00567680 已提交
289

R
RayShih 已提交
290
**示例**
S
s00567680 已提交
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311

```
export default {    data: {        mySlot: {
            type: 3,
            sound: "/sdcard/music2.mp3"
        }    },
    addSlot() {
        reminderAgent.addNotificationSlot(this.mySlot, (err, data) => {
            console.log("do next");
        });
    }
}
```


## reminderAgent.addNotificationSlot

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

添加一个NotificationSlot,使用Promise方式实现异步调用。

R
RayShih 已提交
312
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
313

R
RayShih 已提交
314
**参数**
S
s00567680 已提交
315

X
xuezhongzhu 已提交
316
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
317
| -------- | -------- | -------- | -------- |
R
rcy-hw 已提交
318
| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification&nbsp;slot实例。 |
S
s00567680 已提交
319

R
RayShih 已提交
320
**返回值**
S
s00567680 已提交
321

X
xuezhongzhu 已提交
322
| 类型 | 说明 |
S
s00567680 已提交
323
| -------- | -------- |
X
xuezhongzhu 已提交
324
| Promise&lt;void&gt; | Promise类型异步回调。 |
S
s00567680 已提交
325

R
RayShih 已提交
326
**示例**
S
s00567680 已提交
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347

```
export default {    data: {        mySlot: {
            type: 3,
            sound: "/sdcard/music2.mp3"
        }    },
    addSlot() {
        reminderAgent.addNotificationSlot(this.mySlot).then(() => {
   console.log("do next");
        });
    }
}
```


## reminderAgent.removeNotificationSlot

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

删除目标NotificationSlot,使用callback方式实现异步调用。

R
RayShih 已提交
348
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
349

R
RayShih 已提交
350
**参数**
S
s00567680 已提交
351

X
xuezhongzhu 已提交
352
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
353
| -------- | -------- | -------- | -------- |
R
rcy-hw 已提交
354
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 是 | 目标notification&nbsp;slot的类型。 |
X
xuezhongzhu 已提交
355
| callback | AsyncCallback&lt;void&gt; | 是 | 异步回调。 |
S
s00567680 已提交
356

R
RayShih 已提交
357
**示例**
S
s00567680 已提交
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374

```
export default {
    removeSlot() {reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err, data) => {
            console.log("do next");
});
    }
}
```


## reminderAgent.removeNotificationSlot

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

删除目标NotificationSlot,使用Promise方式实现异步调用。

R
RayShih 已提交
375
**系统能力**: SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
376

R
RayShih 已提交
377
**参数**
S
s00567680 已提交
378

X
xuezhongzhu 已提交
379
| 参数名 | 类型 | 必填 | 说明 |
S
s00567680 已提交
380
| -------- | -------- | -------- | -------- |
R
rcy-hw 已提交
381
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 是 | 目标notification&nbsp;slot的类型。 |
S
s00567680 已提交
382

R
RayShih 已提交
383
**返回值**
S
s00567680 已提交
384

X
xuezhongzhu 已提交
385
| 类型 | 说明 |
S
s00567680 已提交
386
| -------- | -------- |
X
xuezhongzhu 已提交
387
| Promise&lt;void&gt; | Promise类型异步回调。 |
S
s00567680 已提交
388

R
RayShih 已提交
389
**示例**
S
s00567680 已提交
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404

```
export default {
    removeSlot() {        reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
            console.log("do next");
        });
    }
}
```


## ActionButtonType

按钮的类型。

R
RayShih 已提交
405
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
406 407

| 名称 | 默认值 | 说明 |
S
s00567680 已提交
408
| -------- | -------- | -------- |
X
xuezhongzhu 已提交
409 410
| ACTION_BUTTON_TYPE_CLOSE | 0 | 表示关闭提醒的按钮。 |
| ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延迟提醒的按钮。 |
S
s00567680 已提交
411 412 413 414 415 416


## ReminderType

提醒的类型。

R
RayShih 已提交
417
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
418 419

| 名称 | 默认值 | 说明 |
S
s00567680 已提交
420
| -------- | -------- | -------- |
X
xuezhongzhu 已提交
421 422 423
| REMINDER_TYPE_TIMER | 0 | 表示提醒类型:倒计时。 |
| REMINDER_TYPE_CALENDAR | 1 | 表示提醒类型:日历。 |
| REMINDER_TYPE_ALARM | 2 | 表示提醒类型:闹钟。 |
S
s00567680 已提交
424 425 426 427 428 429


## ActionButton

用于设置弹出的提醒通知信息上显示的按钮类型和标题。

R
RayShih 已提交
430
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
431 432

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
433
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
434 435
| title | string | 是 | 按钮显示的标题。 |
| type | [ActionButtonType](#actionbuttontype) | 是 | 按钮的类型。 |
S
s00567680 已提交
436 437 438 439 440 441


## WantAgent

点击提醒通知后跳转的目标ability信息。

R
RayShih 已提交
442
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
443 444

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
445
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
446 447
| pkgName | string | 是 | 指明点击提醒通知栏后跳转的目标hap包名。 |
| abilityName | string | 是 | 指明点击提醒通知栏后跳转的目标ability名称。 |
S
s00567680 已提交
448 449 450 451 452 453


## MaxScreenWantAgent

提醒到达时自动拉起的目标ability信息。

R
RayShih 已提交
454
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
455 456

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
457
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
458 459
| pkgName | string | 是 | 指明提醒到达时自动拉起的目标hap包名(如果设备在使用中,则只弹出通知横幅框)。 |
| abilityName | string | 是 | 指明提醒到达时自动拉起的目标ability名(如果设备在使用中,则只弹出通知横幅框)。 |
S
s00567680 已提交
460 461 462 463 464 465


## ReminderRequest

提醒实例对象,用于设置提醒类型、响铃时长等具体信息。

R
RayShih 已提交
466
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
467 468

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
469
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
470 471 472 473 474 475 476 477 478 479 480 481
| reminderType | ReminderType | 是 | 指明提醒类型。 |
| actionButton | [ActionButton?,&nbsp;ActionButton?] | 否 | 弹出的提醒通知栏中显示的按钮(参数可选,支持0/1/2个按钮)。 |
| wantAgent | WantAgent | 否 | 点击通知后需要跳转的目标ability信息。 |
| maxScreenWantAgent | MaxScreenWantAgent | 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 |
| ringDuration | number | 否 | 指明响铃时长。 |
| snoozeTimes | number | 否 | 指明延迟提醒次数。 |
| timeInterval | number | 否 | 执行延迟提醒间隔。 |
| title | string | 否 | 指明提醒标题。 |
| content | string | 否 | 指明提醒内容。 |
| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 |
| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 |
| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 |
R
rcy-hw 已提交
482
| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 否 | 指明提醒的slot类型。 |
S
s00567680 已提交
483 484 485 486 487 488 489 490


## ReminderRequestCalendar

ReminderRequestCalendar extends ReminderRequest

日历实例对象,用于设置提醒的时间。

R
RayShih 已提交
491
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
492 493

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
494
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
495 496 497
| dateTime | [LocalDateTime](#localdatetime) | 是 | 指明提醒的目标时间。 |
| repeatMonths | Array&lt;number&gt; | 否 | 指明重复提醒的月份。 |
| repeatDays | Array&lt;number&gt; | 否 | 指明重复提醒的日期。 |
S
s00567680 已提交
498 499 500 501 502 503 504 505


## ReminderRequestAlarm

ReminderRequestAlarm extends ReminderRequest

闹钟实例对象,用于设置提醒的时间。

R
RayShih 已提交
506
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
507 508

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
509
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
510 511 512
| hour | number | 是 | 指明提醒的目标时刻。 |
| minute | number | 是 | 指明提醒的目标分钟。 |
| daysOfWeek | Array&lt;number&gt; | 否 | 指明每周哪几天需要重复提醒。 |
S
s00567680 已提交
513 514 515 516 517 518 519 520


## ReminderRequestTimer

ReminderRequestTimer extends ReminderRequest

倒计时实例对象,用于设置提醒的时间。

R
RayShih 已提交
521
**系统能力**:SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
522 523

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
524
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
525
| triggerTimeInSeconds | number | 是 | 指明倒计时的秒数。 |
S
s00567680 已提交
526 527 528 529 530 531


## LocalDateTime

用于日历类提醒设置时指定时间信息。

R
RayShih 已提交
532
**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.ReminderAgent
X
xuezhongzhu 已提交
533 534

| 名称 | 参数类型 | 必填 | 说明 |
S
s00567680 已提交
535
| -------- | -------- | -------- | -------- |
X
xuezhongzhu 已提交
536 537 538 539 540 541
| year | number | 是 | 年 |
| month | number | 是 | 月 |
| day | number | 是 | 日 |
| hour | number | 是 | 时 |
| minute | number | 是 | 分 |
| second | number | 否 | 秒 |