@ohos.reminderAgentManager (后台代理提醒)(系统接口)
本模块提供后台代理提醒的能力,即当应用被冻结或应用退出时,计时和提醒的功能将被系统服务代理。在开发过程中,开发者可以调用本模块接口创建定时提醒,提醒类型支持倒计时、日历、闹钟三种。
说明:
本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
当前页面仅包含本模块的系统接口,其他公开接口请参见@ohos.reminderAgentManager (后台代理提醒)。
导入模块
import reminderAgentManager from '@ohos.reminderAgentManager';
ActionButtonType
按钮的类型。
系统能力:SystemCapability.Notification.ReminderAgent
名称 | 值 | 说明 |
---|---|---|
ACTION_BUTTON_TYPE_CUSTOM10+ | 2 | 表示自定义的按钮。 |
ActionButton
弹出的提醒通知中按钮的类型和标题。
系统能力:SystemCapability.Notification.ReminderAgent
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
wantAgent10+ | WantAgent | 否 | 点击按钮跳转的ability信息。 |
dataShareUpdate11+ | DataShareUpdate | 否 | 点击按钮将更新应用数据库。 |
WantAgent
跳转目标的ability信息。
系统能力:SystemCapability.Notification.ReminderAgent
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
uri10+ | string | 否 | 指明跳转目标的uri信息。 |
DataShareUpdate11+
更新数据库需要的参数信息。
数据提供方需要在module.json5中的proxyDatas节点定义要共享的表的标识,读写权限和基本信息。配置方式请见数据代理。
系统能力:SystemCapability.Notification.ReminderAgent
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
uri | string | 是 | 数据使用的URI,是跨应用数据访问的唯一标识。 |
equalTo | Record<string, number | string | boolean> | 是 | 指示筛选条件,当前仅支持通过等于筛选。 |
value | ValueBucket | 是 | 指示要更新的数据。 |