1# @ohos.reminderAgent (后台代理提醒) 2 3本模块提供后台代理提醒的能力。 4 5开发应用时,开发者可以调用相关接口创建定时提醒,包括倒计时、日历、闹钟这三类提醒类型。使用后台代理提醒能力后,应用被冻结或退出后,计时和弹出提醒的功能将被后台系统服务代理。 6 7> **说明:** 8> 9> 从API Version 9 开始,该接口不再维护,推荐使用新接口[@ohos.reminderAgentManager (后台代理提醒)](js-apis-reminderAgentManager.md) 10> 11> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 12 13 14## 导入模块 15 16```ts 17import reminderAgent from'@ohos.reminderAgent'; 18``` 19 20 21## reminderAgent.publishReminder<sup>(deprecated)</sup> 22 23publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\<number>): void 24 25发布一个后台代理提醒,使用回调的方式实现异步调用,该方法需要申请通知弹窗权限[Notification.requestEnableNotification](../apis-notification-kit/js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 26 27> **说明:** 28> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder)替代。 29 30**需要权限**:ohos.permission.PUBLISH_AGENT_REMINDER 31 32**系统能力**:SystemCapability.Notification.ReminderAgent 33 34**参数**: 35 36 | 参数名 | 类型 | 必填 | 说明 | 37 | -------- | -------- | -------- | -------- | 38 | reminderReq | [ReminderRequest](#reminderrequestdeprecated) | 是 | 需要发布的提醒实例。 | 39 | callback | AsyncCallback\<number> | 是 | 异步回调,返回当前发布的提醒的id。 | 40 41**示例**: 42```ts 43import { BusinessError } from '@ohos.base'; 44 45let timer:reminderAgent.ReminderRequestTimer = { 46 reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, 47 triggerTimeInSeconds: 10 48} 49 50reminderAgent.publishReminder(timer, (err: BusinessError, reminderId: number) => { 51 console.log("callback, reminderId = " + reminderId); 52}); 53``` 54 55 56## reminderAgent.publishReminder<sup>(deprecated)</sup> 57 58publishReminder(reminderReq: ReminderRequest): Promise\<number> 59 60发布一个后台代理提醒,使用Promise方式实现异步调用,该方法需要申请通知弹窗权限[Notification.requestEnableNotification](../apis-notification-kit/js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 61 62> **说明:** 63> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder-1)替代。 64 65**需要权限**:ohos.permission.PUBLISH_AGENT_REMINDER 66 67**系统能力**:SystemCapability.Notification.ReminderAgent 68 69**参数**: 70 | 参数名 | 类型 | 必填 | 说明 | 71 | -------- | -------- | -------- | -------- | 72 | reminderReq | [ReminderRequest](#reminderrequestdeprecated) | 是 | 需要发布的提醒实例。 | 73 74**返回值**: 75 | 类型 | 说明 | 76 | -------- | -------- | 77 | Promise\<number> | 返回提醒的Id。 | 78 79**示例**: 80```ts 81let timer:reminderAgent.ReminderRequestTimer = { 82 reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, 83 triggerTimeInSeconds: 10 84} 85 86reminderAgent.publishReminder(timer).then((reminderId: number) => { 87 console.log("promise, reminderId = " + reminderId); 88}); 89``` 90 91 92## reminderAgent.cancelReminder<sup>(deprecated)</sup> 93 94cancelReminder(reminderId: number, callback: AsyncCallback\<void>): void 95 96取消指定id的提醒,使用回调的方式实现异步调用。 97 98> **说明:** 99> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder)替代。 100 101**系统能力**: SystemCapability.Notification.ReminderAgent 102 103**参数**: 104 105| 参数名 | 类型 | 必填 | 说明 | 106| -------- | -------- | -------- | -------- | 107| reminderId | number | 是 | 目标reminder的id号。 | 108| callback | AsyncCallback\<void> | 是 | 异步回调。 | 109 110**示例**: 111 112```ts 113import { BusinessError } from '@ohos.base'; 114 115reminderAgent.cancelReminder(1, (err: BusinessError, data: void) => { 116 console.log("cancelReminder callback"); 117}); 118``` 119 120 121## reminderAgent.cancelReminder<sup>(deprecated)</sup> 122 123cancelReminder(reminderId: number): Promise\<void> 124 125取消指定id的提醒,使用Promise方式实现异步调用。 126 127> **说明:** 128> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder-1)替代。 129 130**系统能力**: SystemCapability.Notification.ReminderAgent 131 132**参数**: 133 134| 参数名 | 类型 | 必填 | 说明 | 135| -------- | -------- | -------- | -------- | 136| reminderId | number | 是 | 目标reminder的id号。 | 137 138**返回值**: 139 140| 类型 | 说明 | 141| -------- | -------- | 142| Promise\<void> | Promise类型异步回调。 | 143 144**示例**: 145 146```ts 147reminderAgent.cancelReminder(1).then(() => { 148 console.log("cancelReminder promise"); 149}); 150``` 151 152## reminderAgent.getValidReminders<sup>(deprecated)</sup> 153 154getValidReminders(callback: AsyncCallback\<Array\<ReminderRequest>>): void 155 156获取当前应用已设置的所有有效(未过期)的提醒,使用回调的方式实现异步调用。 157 158> **说明:** 159> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders)替代。 160 161**系统能力**: SystemCapability.Notification.ReminderAgent 162 163**参数**: 164 165| 参数名 | 类型 | 必填 | 说明 | 166| -------- | -------- | -------- | -------- | 167| callback | AsyncCallback\<Array\<[ReminderRequest](#reminderrequestdeprecated)>> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 | 168 169**示例**: 170 171```ts 172import { BusinessError } from '@ohos.base'; 173 174reminderAgent.getValidReminders((err: BusinessError, reminders: Array<reminderAgent.ReminderRequest>) => { 175 console.log("callback, getValidReminders length = " + reminders.length); 176 for (let i = 0; i < reminders.length; i++) { 177 console.log("getValidReminders = " + reminders[i]); 178 console.log("getValidReminders, reminderType = " + reminders[i].reminderType); 179 const actionButton = reminders[i].actionButton || []; 180 for (let j = 0; j < actionButton.length; j++) { 181 console.log("getValidReminders, actionButton.title = " + actionButton[j]?.title); 182 console.log("getValidReminders, actionButton.type = " + actionButton[j]?.type); 183 } 184 console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent?.pkgName); 185 console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent?.abilityName); 186 console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration); 187 console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes); 188 console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval); 189 console.log("getValidReminders, title = " + reminders[i].title); 190 console.log("getValidReminders, content = " + reminders[i].content); 191 console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent); 192 console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent); 193 console.log("getValidReminders, notificationId = " + reminders[i].notificationId); 194 console.log("getValidReminders, slotType = " + reminders[i].slotType); 195 } 196}) 197``` 198 199 200## reminderAgent.getValidReminders<sup>(deprecated)</sup> 201 202getValidReminders(): Promise\<Array\<ReminderRequest>> 203 204获取当前应用已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用。 205 206> **说明:** 207> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders-1)替代。 208 209**系统能力**: SystemCapability.Notification.ReminderAgent 210 211**返回值**: 212 213| 类型 | 说明 | 214| -------- | -------- | 215| Promise\<Array\<[ReminderRequest](#reminderrequestdeprecated)>> | 返回当前应用已设置的所有有效(未过期)的提醒。 | 216 217**示例**: 218 219```ts 220reminderAgent.getValidReminders().then((reminders: Array<reminderAgent.ReminderRequest>) => { 221 console.log("promise, getValidReminders length = " + reminders.length); 222 for (let i = 0; i < reminders.length; i++) { 223 console.log("getValidReminders = " + reminders[i]); 224 console.log("getValidReminders, reminderType = " + reminders[i].reminderType); 225 const actionButton = reminders[i].actionButton || []; 226 for (let j = 0; j < actionButton.length; j++) { 227 console.log("getValidReminders, actionButton.title = " + actionButton[j]?.title); 228 console.log("getValidReminders, actionButton.type = " + actionButton[j]?.type); 229 } 230 console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent?.pkgName); 231 console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent?.abilityName); 232 console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration); 233 console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes); 234 console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval); 235 console.log("getValidReminders, title = " + reminders[i].title); 236 console.log("getValidReminders, content = " + reminders[i].content); 237 console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent); 238 console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent); 239 console.log("getValidReminders, notificationId = " + reminders[i].notificationId); 240 console.log("getValidReminders, slotType = " + reminders[i].slotType); 241 } 242}) 243 244``` 245 246 247## reminderAgent.cancelAllReminders<sup>(deprecated)</sup> 248 249cancelAllReminders(callback: AsyncCallback\<void>): void 250 251取消当前应用所有的提醒,使用回调的方式实现异步调用。 252 253> **说明:** 254> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders)替代。 255 256**系统能力**: SystemCapability.Notification.ReminderAgent 257 258**参数**: 259 260| 参数名 | 类型 | 必填 | 说明 | 261| -------- | -------- | -------- | -------- | 262| callback | AsyncCallback\<void> | 是 | 异步回调。 | 263 264**示例**: 265 266```ts 267import { BusinessError } from '@ohos.base'; 268 269reminderAgent.cancelAllReminders((err: BusinessError, data: void) =>{ 270 console.log("cancelAllReminders callback") 271}) 272``` 273 274 275## reminderAgent.cancelAllReminders<sup>(deprecated)</sup> 276 277cancelAllReminders(): Promise\<void> 278 279取消当前应用所有的提醒,使用Promise方式实现异步调用。 280 281> **说明:** 282> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders-1)替代。 283 284**系统能力**: SystemCapability.Notification.ReminderAgent 285 286**返回值**: 287 288| 类型 | 说明 | 289| -------- | -------- | 290| Promise\<void> | Promise类型异步回调。 | 291 292**示例**: 293 294```ts 295reminderAgent.cancelAllReminders().then(() => { 296 console.log("cancelAllReminders promise") 297}) 298``` 299 300## reminderAgent.addNotificationSlot<sup>(deprecated)</sup> 301 302addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\<void>): void 303 304添加一个NotificationSlot,使用回调的方式实现异步调用。 305 306> **说明:** 307> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot)替代。 308 309**系统能力**: SystemCapability.Notification.ReminderAgent 310 311**参数**: 312 313| 参数名 | 类型 | 必填 | 说明 | 314| -------- | -------- | -------- | -------- | 315| slot | [NotificationSlot](../apis-notification-kit/js-apis-notification.md#notificationslot) | 是 | notification\.slot实例,仅支持设置其type属性。 | 316| callback | AsyncCallback\<void> | 是 | 异步回调。 | 317 318**示例**: 319 320```ts 321import notification from '@ohos.notificationManager' 322import { BusinessError } from '@ohos.base'; 323 324let mySlot:notification.NotificationSlot = { 325 type: notification.SlotType.SOCIAL_COMMUNICATION 326} 327reminderAgent.addNotificationSlot(mySlot, (err: BusinessError, data: void) => { 328 console.log("addNotificationSlot callback"); 329}); 330``` 331 332 333## reminderAgent.addNotificationSlot<sup>(deprecated)</sup> 334 335addNotificationSlot(slot: NotificationSlot): Promise\<void> 336 337添加一个NotificationSlot,使用Promise方式实现异步调用。 338 339> **说明:** 340> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot-1)替代。 341 342**系统能力**: SystemCapability.Notification.ReminderAgent 343 344**参数**: 345 346| 参数名 | 类型 | 必填 | 说明 | 347| -------- | -------- | -------- | -------- | 348| slot | [NotificationSlot](../apis-notification-kit/js-apis-notification.md#notificationslot) | 是 | notification\.slot实例,仅支持设置其type属性。 | 349 350**返回值**: 351 352| 类型 | 说明 | 353| -------- | -------- | 354| Promise\<void> | Promise类型异步回调。 | 355 356**示例**: 357 358```ts 359import notification from '@ohos.notificationManager' 360 361let mySlot:notification.NotificationSlot = { 362 type: notification.SlotType.SOCIAL_COMMUNICATION 363} 364reminderAgent.addNotificationSlot(mySlot).then(() => { 365 console.log("addNotificationSlot promise"); 366}); 367``` 368 369 370## reminderAgent.removeNotificationSlot<sup>(deprecated)</sup> 371 372removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback\<void>): void 373 374删除目标NotificationSlot,使用callback方式实现异步调用。 375 376> **说明:** 377> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot)替代。 378 379**系统能力**:SystemCapability.Notification.ReminderAgent 380 381**参数**: 382 383| 参数名 | 类型 | 必填 | 说明 | 384| -------- | -------- | -------- | -------- | 385| slotType | [notification.SlotType](../apis-notification-kit/js-apis-notification.md#slottype) | 是 | 目标notification\.slot的类型。 | 386| callback | AsyncCallback\<void> | 是 | 异步回调。 | 387 388**示例**: 389 390```ts 391import notification from '@ohos.notification' 392import { BusinessError } from '@ohos.base'; 393 394reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err: BusinessError, data: void) => { 395 console.log("removeNotificationSlot callback"); 396}); 397``` 398 399 400## reminderAgent.removeNotificationSlot<sup>(deprecated)</sup> 401 402removeNotificationSlot(slotType: notification.SlotType): Promise\<void> 403 404删除目标NotificationSlot,使用Promise方式实现异步调用。 405 406> **说明:** 407> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot-1)替代。 408 409**系统能力**:SystemCapability.Notification.ReminderAgent 410 411**参数**: 412 413| 参数名 | 类型 | 必填 | 说明 | 414| -------- | -------- | -------- | -------- | 415| slotType | [notification.SlotType](../apis-notification-kit/js-apis-notification.md#slottype) | 是 | 目标notification\.slot的类型。 | 416 417**返回值**: 418 419| 类型 | 说明 | 420| -------- | -------- | 421| Promise\<void> | Promise类型异步回调。 | 422 423**示例**: 424 425```ts 426import notification from '@ohos.notification' 427 428reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => { 429 console.log("removeNotificationSlot promise"); 430}); 431``` 432 433 434## ActionButtonType<sup>(deprecated)</sup> 435 436按钮的类型。 437 438> **说明:** 439> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButtonType](js-apis-reminderAgentManager.md#ActionButtonType)替代。 440 441**系统能力**:SystemCapability.Notification.ReminderAgent 442 443| 名称 | 值 | 说明 | 444| -------- | -------- | -------- | 445| ACTION_BUTTON_TYPE_CLOSE | 0 | 表示关闭提醒的按钮。 | 446| ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延迟提醒的按钮。 | 447 448 449## ReminderType<sup>(deprecated)</sup> 450 451提醒的类型。 452 453> **说明:** 454> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderType](js-apis-reminderAgentManager.md#ReminderType)替代。 455 456**系统能力**:SystemCapability.Notification.ReminderAgent 457 458| 名称 | 值 | 说明 | 459| -------- | -------- | -------- | 460| REMINDER_TYPE_TIMER | 0 | 表示提醒类型:倒计时。 | 461| REMINDER_TYPE_CALENDAR | 1 | 表示提醒类型:日历。 | 462| REMINDER_TYPE_ALARM | 2 | 表示提醒类型:闹钟。 | 463 464 465## ActionButton<sup>(deprecated)</sup> 466 467用于设置弹出的提醒通知信息上显示的按钮类型和标题。 468 469> **说明:** 470> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButton](js-apis-reminderAgentManager.md#ActionButton)替代。 471 472**系统能力**:SystemCapability.Notification.ReminderAgent 473 474| 名称 | 类型 | 必填 | 说明 | 475| -------- | -------- | -------- | -------- | 476| title | string | 是 | 按钮显示的标题。 | 477| type | [ActionButtonType](#actionbuttontypedeprecated) | 是 | 按钮的类型。 | 478 479 480## WantAgent<sup>(deprecated)</sup> 481 482点击提醒通知后跳转的目标ability信息。 483 484> **说明:** 485> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.WantAgent](js-apis-reminderAgentManager.md#WantAgent)替代。 486 487**系统能力**:SystemCapability.Notification.ReminderAgent 488 489| 名称 | 类型 | 必填 | 说明 | 490| -------- | -------- | -------- | -------- | 491| pkgName | string | 是 | 指明点击提醒通知栏后跳转的目标HAP名。 | 492| abilityName | string | 是 | 指明点击提醒通知栏后跳转的目标ability名称。 | 493 494 495## MaxScreenWantAgent<sup>(deprecated)</sup> 496 497全屏显示提醒到达时自动拉起的目标ability信息,该接口预留。 498 499> **说明:** 500> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.MaxScreenWantAgent](js-apis-reminderAgentManager.md#maxscreenwantagent)替代。 501 502**系统能力**:SystemCapability.Notification.ReminderAgent 503 504| 名称 | 类型 | 必填 | 说明 | 505| -------- | -------- | -------- | -------- | 506| pkgName | string | 是 | 指明提醒到达时自动拉起的目标HAP名(如果设备在使用中,则只弹出通知横幅框)。 | 507| abilityName | string | 是 | 指明提醒到达时自动拉起的目标ability名(如果设备在使用中,则只弹出通知横幅框)。 | 508 509 510## ReminderRequest<sup>(deprecated)</sup> 511 512提醒实例对象,用于设置提醒类型、响铃时长等具体信息。 513 514> **说明:** 515> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequest](js-apis-reminderAgentManager.md#ReminderRequest)替代。 516 517**系统能力**:SystemCapability.Notification.ReminderAgent 518 519| 名称 | 类型 | 必填 | 说明 | 520| -------- | -------- | -------- | -------- | 521| reminderType | [ReminderType](#remindertypedeprecated) | 是 | 指明提醒类型。 | 522| actionButton | [[ActionButton?, ActionButton?]](#actionbuttondeprecated) | 否 | 弹出的提醒通知栏中显示的按钮(参数可选,支持0/1/2个按钮)。 | 523| wantAgent | WantAgent | 否 | 点击通知后需要跳转的目标ability信息。 | 524| maxScreenWantAgent | [MaxScreenWantAgent](#maxscreenwantagentdeprecated) | 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 | 525| ringDuration | number | 否 | 指明响铃时长(单位:秒),默认1秒。 | 526| snoozeTimes | number | 否 | 指明延迟提醒次数,默认0次。 | 527| timeInterval | number | 否 | 执行延迟提醒间隔(单位:秒),默认0秒。 | 528| title | string | 否 | 指明提醒标题。 | 529| content | string | 否 | 指明提醒内容。 | 530| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 | 531| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 | 532| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 | 533| slotType | [notification.SlotType](../apis-notification-kit/js-apis-notification.md#slottype) | 否 | 指明提醒的slot类型。 | 534 535 536## ReminderRequestCalendar<sup>(deprecated)</sup> 537 538 539日历实例对象,用于设置提醒的时间。 540 541> **说明:** 542> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestCalendar](js-apis-reminderAgentManager.md#ReminderRequestCalendar)替代。 543 544**系统能力**:SystemCapability.Notification.ReminderAgent 545 546| 名称 | 类型 | 必填 | 说明 | 547| -------- | -------- | -------- | -------- | 548| dateTime | [LocalDateTime](#localdatetimedeprecated) | 是 | 指明提醒的目标时间。 | 549| repeatMonths | Array\<number> | 否 | 指明重复提醒的月份。 | 550| repeatDays | Array\<number> | 否 | 指明重复提醒的日期。 | 551 552 553## ReminderRequestAlarm<sup>(deprecated)</sup> 554 555 556闹钟实例对象,用于设置提醒的时间。 557 558> **说明:** 559> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestAlarm](js-apis-reminderAgentManager.md#ReminderRequestAlarm)替代。 560 561**系统能力**:SystemCapability.Notification.ReminderAgent 562 563| 名称 | 类型 | 必填 | 说明 | 564| -------- | -------- | -------- | -------- | 565| hour | number | 是 | 指明提醒的目标时刻。 | 566| minute | number | 是 | 指明提醒的目标分钟。 | 567| daysOfWeek | Array\<number> | 否 | 指明每周哪几天需要重复提醒。范围为周一到周末,对应数字为1到7。 | 568 569 570## ReminderRequestTimer<sup>(deprecated)</sup> 571 572倒计时实例对象,用于设置提醒的时间。 573 574> **说明:** 575> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestTimer](js-apis-reminderAgentManager.md#ReminderRequestTimer)替代。 576 577**系统能力**:SystemCapability.Notification.ReminderAgent 578 579| 名称 | 类型 | 必填 | 说明 | 580| -------- | -------- | -------- | -------- | 581| triggerTimeInSeconds | number | 是 | 指明倒计时的秒数。 | 582 583 584## LocalDateTime<sup>(deprecated)</sup> 585 586用于日历类提醒设置时指定时间信息。 587 588> **说明:** 589> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.LocalDateTime](js-apis-reminderAgentManager.md#LocalDateTime)替代。 590 591**系统能力**:SystemCapability.Notification.ReminderAgent 592 593| 名称 | 类型 | 必填 | 说明 | 594| -------- | -------- | -------- | -------- | 595| year | number | 是 | 年 | 596| month | number | 是 | 月 | 597| day | number | 是 | 日 | 598| hour | number | 是 | 时 | 599| minute | number | 是 | 分 | 600| second | number | 否 | 秒 | 601