• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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](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](#reminderrequest) | 是 | 需要发布的提醒实例。 |
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](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](#reminderrequest) | 是 | 需要发布的提醒实例。 |
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号,[publishReminder](#reminderagentpublishreminder)方法调用成功后获得。 |
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号,[publishReminder](#reminderagentpublishreminder)方法调用成功后获得。 |
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](#reminderrequest)>> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 |
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, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent?.pkgName);
187    console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent?.abilityName);
188    console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
189    console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
190    console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
191    console.log("getValidReminders, title = " + reminders[i].title);
192    console.log("getValidReminders, content = " + reminders[i].content);
193    console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
194    console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
195    console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
196    console.log("getValidReminders, slotType = " + reminders[i].slotType);
197  }
198})
199```
200
201
202## reminderAgent.getValidReminders<sup>(deprecated)</sup>
203
204getValidReminders(): Promise\<Array\<ReminderRequest>>
205
206获取当前应用已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用。
207
208> **说明:**
209> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders-1)替代。
210
211**系统能力**: SystemCapability.Notification.ReminderAgent
212
213**返回值**:
214
215| 类型 | 说明 |
216| -------- | -------- |
217| Promise\<Array\<[ReminderRequest](#reminderrequest)>> | 返回当前应用已设置的所有有效(未过期)的提醒。 |
218
219**示例**:
220
221```ts
222reminderAgent.getValidReminders().then((reminders: Array<reminderAgent.ReminderRequest>) => {
223  console.log("promise, getValidReminders length = " + reminders.length);
224  for (let i = 0; i < reminders.length; i++) {
225    console.log("getValidReminders = " + reminders[i]);
226    console.log("getValidReminders, reminderType = " + reminders[i].reminderType);
227    const actionButton = reminders[i].actionButton || [];
228    for (let j = 0; j < actionButton.length; j++) {
229      console.log("getValidReminders, actionButton.title = " + actionButton[j]?.title);
230      console.log("getValidReminders, actionButton.type = " + actionButton[j]?.type);
231    }
232    console.log("getValidReminders, wantAgent.pkgName = " + reminders[i].wantAgent?.pkgName);
233    console.log("getValidReminders, wantAgent.abilityName = " + reminders[i].wantAgent?.abilityName);
234    console.log("getValidReminders, maxScreenWantAgent.pkgName = " + reminders[i].maxScreenWantAgent?.pkgName);
235    console.log("getValidReminders, maxScreenWantAgent.abilityName = " + reminders[i].maxScreenWantAgent?.abilityName);
236    console.log("getValidReminders, ringDuration = " + reminders[i].ringDuration);
237    console.log("getValidReminders, snoozeTimes = " + reminders[i].snoozeTimes);
238    console.log("getValidReminders, timeInterval = " + reminders[i].timeInterval);
239    console.log("getValidReminders, title = " + reminders[i].title);
240    console.log("getValidReminders, content = " + reminders[i].content);
241    console.log("getValidReminders, expiredContent = " + reminders[i].expiredContent);
242    console.log("getValidReminders, snoozeContent = " + reminders[i].snoozeContent);
243    console.log("getValidReminders, notificationId = " + reminders[i].notificationId);
244    console.log("getValidReminders, slotType = " + reminders[i].slotType);
245  }
246})
247
248```
249
250
251## reminderAgent.cancelAllReminders<sup>(deprecated)</sup>
252
253cancelAllReminders(callback: AsyncCallback\<void>): void
254
255取消当前应用所有的提醒,使用回调的方式实现异步调用。
256
257> **说明:**
258> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders)替代。
259
260**系统能力**: SystemCapability.Notification.ReminderAgent
261
262**参数**:
263
264| 参数名 | 类型 | 必填 | 说明 |
265| -------- | -------- | -------- | -------- |
266| callback | AsyncCallback\<void> | 是 | 异步回调。 |
267
268**示例**:
269
270```ts
271import { BusinessError } from '@ohos.base';
272
273reminderAgent.cancelAllReminders((err: BusinessError, data: void) =>{
274  console.log("cancelAllReminders callback")
275})
276```
277
278
279## reminderAgent.cancelAllReminders<sup>(deprecated)</sup>
280
281cancelAllReminders(): Promise\<void>
282
283取消当前应用所有的提醒,使用Promise方式实现异步调用。
284
285> **说明:**
286> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders-1)替代。
287
288**系统能力**: SystemCapability.Notification.ReminderAgent
289
290**返回值**:
291
292| 类型 | 说明 |
293| -------- | -------- |
294| Promise\<void> | Promise类型异步回调。 |
295
296**示例**:
297
298```ts
299reminderAgent.cancelAllReminders().then(() => {
300    console.log("cancelAllReminders promise")
301})
302```
303
304## reminderAgent.addNotificationSlot<sup>(deprecated)</sup>
305
306addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\<void>): void
307
308添加一个NotificationSlot,使用回调的方式实现异步调用。
309
310> **说明:**
311> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot)替代。
312
313**系统能力**: SystemCapability.Notification.ReminderAgent
314
315**参数**:
316
317| 参数名 | 类型 | 必填 | 说明 |
318| -------- | -------- | -------- | -------- |
319| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification\.slot实例,仅支持设置其type属性。 |
320| callback | AsyncCallback\<void> | 是 | 异步回调。 |
321
322**示例**:
323
324```ts
325import notification from '@ohos.notificationManager'
326import { BusinessError } from '@ohos.base';
327
328let mySlot:notification.NotificationSlot = {
329  type: notification.SlotType.SOCIAL_COMMUNICATION
330}
331reminderAgent.addNotificationSlot(mySlot, (err: BusinessError, data: void) => {
332  console.log("addNotificationSlot callback");
333});
334```
335
336
337## reminderAgent.addNotificationSlot<sup>(deprecated)</sup>
338
339addNotificationSlot(slot: NotificationSlot): Promise\<void>
340
341添加一个NotificationSlot,使用Promise方式实现异步调用。
342
343> **说明:**
344> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot-1)替代。
345
346**系统能力**: SystemCapability.Notification.ReminderAgent
347
348**参数**:
349
350| 参数名 | 类型 | 必填 | 说明 |
351| -------- | -------- | -------- | -------- |
352| slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification\.slot实例,仅支持设置其type属性。 |
353
354**返回值**:
355
356| 类型 | 说明 |
357| -------- | -------- |
358| Promise\<void> | Promise类型异步回调。 |
359
360**示例**:
361
362```ts
363import notification from '@ohos.notificationManager'
364
365let mySlot:notification.NotificationSlot = {
366  type: notification.SlotType.SOCIAL_COMMUNICATION
367}
368reminderAgent.addNotificationSlot(mySlot).then(() => {
369  console.log("addNotificationSlot promise");
370});
371```
372
373
374## reminderAgent.removeNotificationSlot<sup>(deprecated)</sup>
375
376removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback\<void>): void
377
378删除目标NotificationSlot,使用callback方式实现异步调用。
379
380> **说明:**
381> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot)替代。
382
383**系统能力**:SystemCapability.Notification.ReminderAgent
384
385**参数**:
386
387| 参数名 | 类型 | 必填 | 说明 |
388| -------- | -------- | -------- | -------- |
389| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 是 | 目标notification\.slot的类型。 |
390| callback | AsyncCallback\<void> | 是 | 异步回调。 |
391
392**示例**:
393
394```ts
395import notification from '@ohos.notification'
396import { BusinessError } from '@ohos.base';
397
398reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, (err: BusinessError, data: void) => {
399  console.log("removeNotificationSlot callback");
400});
401```
402
403
404## reminderAgent.removeNotificationSlot<sup>(deprecated)</sup>
405
406removeNotificationSlot(slotType: notification.SlotType): Promise\<void>
407
408删除目标NotificationSlot,使用Promise方式实现异步调用。
409
410> **说明:**
411> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot-1)替代。
412
413**系统能力**:SystemCapability.Notification.ReminderAgent
414
415**参数**:
416
417| 参数名 | 类型 | 必填 | 说明 |
418| -------- | -------- | -------- | -------- |
419| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 是 | 目标notification\.slot的类型。 |
420
421**返回值**:
422
423| 类型 | 说明 |
424| -------- | -------- |
425| Promise\<void> | Promise类型异步回调。 |
426
427**示例**:
428
429```ts
430import notification from '@ohos.notification'
431
432reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION).then(() => {
433    console.log("removeNotificationSlot promise");
434});
435```
436
437
438## ActionButtonType<sup>(deprecated)</sup>
439
440按钮的类型。
441
442> **说明:**
443> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButtonType](js-apis-reminderAgentManager.md#ActionButtonType)替代。
444
445**系统能力**:SystemCapability.Notification.ReminderAgent
446
447| 名称 | 值 | 说明 |
448| -------- | -------- | -------- |
449| ACTION_BUTTON_TYPE_CLOSE | 0 | 表示关闭提醒的按钮。 |
450| ACTION_BUTTON_TYPE_SNOOZE | 1 | 表示延迟提醒的按钮。 |
451
452
453## ReminderType<sup>(deprecated)</sup>
454
455提醒的类型。
456
457> **说明:**
458> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderType](js-apis-reminderAgentManager.md#ReminderType)替代。
459
460**系统能力**:SystemCapability.Notification.ReminderAgent
461
462| 名称 | 值 | 说明 |
463| -------- | -------- | -------- |
464| REMINDER_TYPE_TIMER | 0 | 表示提醒类型:倒计时。 |
465| REMINDER_TYPE_CALENDAR | 1 | 表示提醒类型:日历。 |
466| REMINDER_TYPE_ALARM | 2 | 表示提醒类型:闹钟。 |
467
468
469## ActionButton<sup>(deprecated)</sup>
470
471用于设置弹出的提醒通知信息上显示的按钮类型和标题。
472
473> **说明:**
474> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButton](js-apis-reminderAgentManager.md#ActionButton)替代。
475
476**系统能力**:SystemCapability.Notification.ReminderAgent
477
478| 名称 | 类型 | 必填 | 说明 |
479| -------- | -------- | -------- | -------- |
480| title | string | 是 | 按钮显示的标题。 |
481| type | [ActionButtonType](#actionbuttontype) | 是 | 按钮的类型。 |
482
483
484## WantAgent<sup>(deprecated)</sup>
485
486点击提醒通知后跳转的目标ability信息。
487
488> **说明:**
489> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.WantAgent](js-apis-reminderAgentManager.md#WantAgent)替代。
490
491**系统能力**:SystemCapability.Notification.ReminderAgent
492
493| 名称 | 类型 | 必填 | 说明 |
494| -------- | -------- | -------- | -------- |
495| pkgName | string | 是 | 指明点击提醒通知栏后跳转的目标HAP名。 |
496| abilityName | string | 是 | 指明点击提醒通知栏后跳转的目标ability名称。 |
497
498
499## MaxScreenWantAgent<sup>(deprecated)</sup>
500
501全屏显示提醒到达时自动拉起的目标ability信息,该接口预留。
502
503> **说明:**
504> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.MaxScreenWantAgent](js-apis-reminderAgentManager.md#MaxScreenWantAgent)替代。
505
506**系统能力**:SystemCapability.Notification.ReminderAgent
507
508| 名称 | 类型 | 必填 | 说明 |
509| -------- | -------- | -------- | -------- |
510| pkgName | string | 是 | 指明提醒到达时自动拉起的目标HAP名(如果设备在使用中,则只弹出通知横幅框)。 |
511| abilityName | string | 是 | 指明提醒到达时自动拉起的目标ability名(如果设备在使用中,则只弹出通知横幅框)。 |
512
513
514## ReminderRequest<sup>(deprecated)</sup>
515
516提醒实例对象,用于设置提醒类型、响铃时长等具体信息。
517
518> **说明:**
519> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequest](js-apis-reminderAgentManager.md#ReminderRequest)替代。
520
521**系统能力**:SystemCapability.Notification.ReminderAgent
522
523| 名称 | 类型 | 必填 | 说明 |
524| -------- | -------- | -------- | -------- |
525| reminderType | [ReminderType](#remindertype) | 是 | 指明提醒类型。 |
526| actionButton | [ActionButton](#actionbutton) | 否 | 弹出的提醒通知栏中显示的按钮(参数可选,支持0/1/2个按钮)。 |
527| wantAgent | [WantAgent](#wantagent) | 否 | 点击通知后需要跳转的目标ability信息。 |
528| maxScreenWantAgent | [MaxScreenWantAgent](#maxscreenwantagent) | 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 |
529| ringDuration | number | 否 | 指明响铃时长(单位:秒),默认1秒。 |
530| snoozeTimes | number | 否 | 指明延迟提醒次数,默认0次。 |
531| timeInterval | number | 否 | 执行延迟提醒间隔(单位:秒),默认0秒。 |
532| title | string | 否 | 指明提醒标题。 |
533| content | string | 否 | 指明提醒内容。 |
534| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 |
535| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 |
536| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 |
537| slotType | [notification.SlotType](js-apis-notification.md#slottype) | 否 | 指明提醒的slot类型。 |
538
539
540## ReminderRequestCalendar<sup>(deprecated)</sup>
541
542
543日历实例对象,用于设置提醒的时间。
544
545> **说明:**
546> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestCalendar](js-apis-reminderAgentManager.md#ReminderRequestCalendar)替代。
547
548**系统能力**:SystemCapability.Notification.ReminderAgent
549
550| 名称 | 类型 | 必填 | 说明 |
551| -------- | -------- | -------- | -------- |
552| dateTime | [LocalDateTime](#localdatetime) | 是 | 指明提醒的目标时间。 |
553| repeatMonths | Array\<number> | 否 | 指明重复提醒的月份。 |
554| repeatDays | Array\<number> | 否 | 指明重复提醒的日期。 |
555
556
557## ReminderRequestAlarm<sup>(deprecated)</sup>
558
559
560闹钟实例对象,用于设置提醒的时间。
561
562> **说明:**
563> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestAlarm](js-apis-reminderAgentManager.md#ReminderRequestAlarm)替代。
564
565**系统能力**:SystemCapability.Notification.ReminderAgent
566
567| 名称 | 类型 | 必填 | 说明 |
568| -------- | -------- | -------- | -------- |
569| hour | number | 是 | 指明提醒的目标时刻。 |
570| minute | number | 是 | 指明提醒的目标分钟。 |
571| daysOfWeek | Array\<number> | 否 | 指明每周哪几天需要重复提醒。范围为周一到周末,对应数字为1到7。 |
572
573
574## ReminderRequestTimer<sup>(deprecated)</sup>
575
576倒计时实例对象,用于设置提醒的时间。
577
578> **说明:**
579> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestTimer](js-apis-reminderAgentManager.md#ReminderRequestTimer)替代。
580
581**系统能力**:SystemCapability.Notification.ReminderAgent
582
583| 名称 | 类型 | 必填 | 说明 |
584| -------- | -------- | -------- | -------- |
585| triggerTimeInSeconds | number | 是 | 指明倒计时的秒数。 |
586
587
588## LocalDateTime<sup>(deprecated)</sup>
589
590用于日历类提醒设置时指定时间信息。
591
592> **说明:**
593> 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.LocalDateTime](js-apis-reminderAgentManager.md#LocalDateTime)替代。
594
595**系统能力**:SystemCapability.Notification.ReminderAgent
596
597| 名称 | 类型 | 必填 | 说明 |
598| -------- | -------- | -------- | -------- |
599| year | number | 是 | 年 |
600| month | number | 是 | 月 |
601| day | number | 是 | 日 |
602| hour | number | 是 | 时 |
603| minute | number | 是 | 分 |
604| second | number | 否 | 秒 |
605