Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
626dcf72
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
626dcf72
编写于
8月 08, 2023
作者:
N
ningning
提交者:
Gitee
8月 08, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md.
Signed-off-by:
N
ningning
<
wangningning14@huawei.com
>
上级
947a1eb5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
43 deletion
+45
-43
zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md
...cation-dev/reference/apis/js-apis-reminderAgentManager.md
+45
-43
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md
浏览文件 @
626dcf72
...
@@ -15,12 +15,15 @@
...
@@ -15,12 +15,15 @@
import
reminderAgentManager
from
'
@ohos.reminderAgentManager
'
;
import
reminderAgentManager
from
'
@ohos.reminderAgentManager
'
;
```
```
## reminderAgentManager.publishReminder
## reminderAgentManager.publishReminder
publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback
\<
number>): void
publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback
\<
number>): void
发布一个后台代理提醒,使用回调的方式实现异步调用,该方法需要申请通知弹窗权限
[
Notification.requestEnableNotification
](
js-apis-notification.md#notificationrequestenablenotification8
)
后才能调用。
发布后台代理提醒。使用callback异步回调。
> **说明:**
>
> 需要申请通知弹窗权限[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后调用。
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
...
@@ -30,12 +33,12 @@ publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\<number>):
...
@@ -30,12 +33,12 @@ publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\<number>):
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderReq |
[
ReminderRequest
](
#reminderrequest
)
| 是 | 需要发布的提醒实例。 |
| reminderReq |
[
ReminderRequest
](
#reminderrequest
)
| 是 | 需要发布的提醒实例
对象
。 |
| callback | AsyncCallback
\<
number> | 是 |
异步回调,返回当前发布的
提醒的id。 |
| callback | AsyncCallback
\<
number> | 是 |
回调函数,返回当前发布
提醒的id。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -62,12 +65,15 @@ try {
...
@@ -62,12 +65,15 @@ try {
};
};
```
```
## reminderAgentManager.publishReminder
## reminderAgentManager.publishReminder
publishReminder(reminderReq: ReminderRequest): Promise
\<
number>
publishReminder(reminderReq: ReminderRequest): Promise
\<
number>
发布一个后台代理提醒,使用
`Promise`
的方式实现异步调用,该方法需要申请通知弹窗权限
[
Notification.requestEnableNotification
](
js-apis-notification.md#notificationrequestenablenotification8
)
后才能调用。
发布后台代理提醒。使用callback异步回调。
> **说明:**
>
> 需要申请通知弹窗权限[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后调用。
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
...
@@ -85,7 +91,7 @@ publishReminder(reminderReq: ReminderRequest): Promise\<number>
...
@@ -85,7 +91,7 @@ publishReminder(reminderReq: ReminderRequest): Promise\<number>
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -115,7 +121,7 @@ try {
...
@@ -115,7 +121,7 @@ try {
cancelReminder(reminderId: number, callback: AsyncCallback
\<
void>): void
cancelReminder(reminderId: number, callback: AsyncCallback
\<
void>): void
取消指定
id的提醒,使用回调的方式实现异步调用
。
取消指定
Id的代理提醒。使用callback异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -123,12 +129,12 @@ cancelReminder(reminderId: number, callback: AsyncCallback\<void>): void
...
@@ -123,12 +129,12 @@ cancelReminder(reminderId: number, callback: AsyncCallback\<void>): void
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderId | number | 是 |
目标提醒的id号
。 |
| reminderId | number | 是 |
代理提醒的Id
。 |
| callback | AsyncCallback
\<
void> | 是 |
异步回调
。 |
| callback | AsyncCallback
\<
void> | 是 |
回调函数,取消代理提醒成功,error为undefined,否则返回error信息
。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -151,12 +157,11 @@ try {
...
@@ -151,12 +157,11 @@ try {
};
};
```
```
## reminderAgentManager.cancelReminder
## reminderAgentManager.cancelReminder
cancelReminder(reminderId: number): Promise
\<
void>
cancelReminder(reminderId: number): Promise
\<
void>
取消指定
id的提醒,使用Promise方式实现异步调用
。
取消指定
Id的代理提醒。使用Promise异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -164,17 +169,17 @@ cancelReminder(reminderId: number): Promise\<void>
...
@@ -164,17 +169,17 @@ cancelReminder(reminderId: number): Promise\<void>
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderId | number | 是 |
目标提醒的id号
。 |
| reminderId | number | 是 |
代理提醒的Id
。 |
**返回值**
:
**返回值**
:
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
| Promise
\<
void> |
Promise类型异步回调
。 |
| Promise
\<
void> |
无返回结果的Promise对象
。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -199,8 +204,7 @@ try {
...
@@ -199,8 +204,7 @@ try {
getValidReminders(callback: AsyncCallback
<Array
\<
ReminderRequest
>
>): void
getValidReminders(callback: AsyncCallback
<Array
\<
ReminderRequest
>
>): void
获取当前应用设置的所有有效(未过期)的代理提醒。使用callback异步回调。
获取当前应用已设置的所有有效(未过期)的提醒,使用回调方式实现异步调用。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -208,11 +212,11 @@ getValidReminders(callback: AsyncCallback<Array\<ReminderRequest>>): void
...
@@ -208,11 +212,11 @@ getValidReminders(callback: AsyncCallback<Array\<ReminderRequest>>): void
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback
\<
Array
\<
[
ReminderRequest
](
#reminderrequest
)
>> | 是 |
异步回调,返回当前应用已设置的所有有效(未过期)的
提醒。 |
| callback | AsyncCallback
\<
Array
\<
[
ReminderRequest
](
#reminderrequest
)
>> | 是 |
回调函数,返回当前应用已设置的所有有效(未过期)的代理
提醒。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -259,7 +263,7 @@ try {
...
@@ -259,7 +263,7 @@ try {
getValidReminders(): Promise
\<
Array
\<
ReminderRequest>>
getValidReminders(): Promise
\<
Array
\<
ReminderRequest>>
获取当前应用
已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用
。
获取当前应用
设置的所有有效(未过期)的代理提醒。使用promise异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -267,11 +271,11 @@ getValidReminders(): Promise\<Array\<ReminderRequest>>
...
@@ -267,11 +271,11 @@ getValidReminders(): Promise\<Array\<ReminderRequest>>
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
| Promise
\<
Array
\<
[
ReminderRequest
](
#reminderrequest
)
>> | 返回当前应用已设置的所有有效(未过期)的提醒。 |
| Promise
\<
Array
\<
[
ReminderRequest
](
#reminderrequest
)
>> | 返回当前应用已设置的所有有效(未过期)的
代理
提醒。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -312,12 +316,11 @@ try {
...
@@ -312,12 +316,11 @@ try {
};
};
```
```
## reminderAgentManager.cancelAllReminders
## reminderAgentManager.cancelAllReminders
cancelAllReminders(callback: AsyncCallback
\<
void>): void
cancelAllReminders(callback: AsyncCallback
\<
void>): void
取消当前应用
所有的提醒,使用回调的方式实现异步调用
。
取消当前应用
设置的所有代理提醒。使用callback异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -325,11 +328,11 @@ cancelAllReminders(callback: AsyncCallback\<void>): void
...
@@ -325,11 +328,11 @@ cancelAllReminders(callback: AsyncCallback\<void>): void
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback
\<
void> | 是 |
异步回调。
|
| callback | AsyncCallback
\<
void> | 是 |
回调函数,取消代理提醒成功,error为undefined,否则返回error信息。
|
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -351,12 +354,11 @@ try {
...
@@ -351,12 +354,11 @@ try {
};
};
```
```
## reminderAgentManager.cancelAllReminders
## reminderAgentManager.cancelAllReminders
cancelAllReminders(): Promise
\<
void>
cancelAllReminders(): Promise
\<
void>
取消当前应用
所有的提醒,使用Promise方式实现异步调用
。
取消当前应用
设置的所有代理提醒。使用Promise异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -364,11 +366,11 @@ cancelAllReminders(): Promise\<void>
...
@@ -364,11 +366,11 @@ cancelAllReminders(): Promise\<void>
| 类型 | 说明 |
| 类型 | 说明 |
| -------- | -------- |
| -------- | -------- |
| Promise
\<
void> |
Promise类型异步回调
。 |
| Promise
\<
void> |
无返回结果的Promise对象
。 |
**错误码:**
**错误码:**
以下错误码的详细介绍请参见
[
@ohos.reminderAgentManager(后台代理提醒)
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
以下错误码的详细介绍请参见
[
reminderAgentManager错误码
](
../errorcodes/errorcode-reminderAgentManager.md
)
错误码。
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| --------- | ------- |
| --------- | ------- |
...
@@ -393,7 +395,7 @@ try {
...
@@ -393,7 +395,7 @@ try {
addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback
\<
void>): void
addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback
\<
void>): void
添加
一个NotificationSlot,使用回调的方式实现异步调用
。
添加
NotificationSlot////中文是什么(通知槽吗,通知槽是通知栏吗)。使用callback异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -470,7 +472,7 @@ try {
...
@@ -470,7 +472,7 @@ try {
removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback
\<
void>): void
removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback
\<
void>): void
删除目标NotificationSlot,使用
回调的方式实现异步调用
。
删除目标NotificationSlot,使用
callback异步回调
。
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
...
@@ -585,14 +587,14 @@ try {
...
@@ -585,14 +587,14 @@ try {
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| pkgName | string | 是 | 指明跳转
的目标
包名。 |
| pkgName | string | 是 | 指明跳转
目标的
包名。 |
| abilityName | string | 是 | 指明跳转
的目标
ability名称。 |
| abilityName | string | 是 | 指明跳转
目标的
ability名称。 |
| uri
<sup>
10+
</sup>
| string | 否 | 指明跳转目标的uri信息。
<br>
**系统接口**
: 系统接口,三方应用不支持调用。 |
| uri
<sup>
10+
</sup>
| string | 否 | 指明跳转目标的uri信息。
<br>
**系统接口**
: 系统接口,三方应用不支持调用。 |
## MaxScreenWantAgent
## MaxScreenWantAgent
全屏显示提醒到达时
自动拉起的目标ability信息,该接口预留。
全屏显示提醒到达时
,自动拉起目标的ability信息,预留接口。////全屏显示提醒到达是什么意思
**系统能力**
:SystemCapability.Notification.ReminderAgent
**系统能力**
:SystemCapability.Notification.ReminderAgent
...
@@ -604,16 +606,16 @@ try {
...
@@ -604,16 +606,16 @@ try {
## ReminderRequest
## ReminderRequest
提醒实例对象,用于设置提醒类型、响铃时长等具体信息。
代理
提醒实例对象,用于设置提醒类型、响铃时长等具体信息。
**系统能力**
:SystemCapability.Notification.ReminderAgent
**系统能力**
:SystemCapability.Notification.ReminderAgent
| 名称 | 类型 | 必填 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| reminderType |
[
ReminderType
](
#remindertype
)
| 是 | 指明提醒类型。 |
| reminderType |
[
ReminderType
](
#remindertype
)
| 是 | 指明
代理
提醒类型。 |
| actionButton
<sup></sup>
|
[
ActionButton
](
#actionbutton
)
| 否 | 弹出的提醒通知栏中显示的按钮。
<br>
-普通应用:最多支持两个按钮。
<br>
-系统应用:API9最多支持两个按钮,在API10开始最多支持三个按钮。 |
| actionButton
<sup></sup>
|
[
ActionButton
](
#actionbutton
)
| 否 | 弹出的提醒通知栏中显示的按钮。
<br>
-普通应用:最多支持两个按钮。
<br>
-系统应用:API9最多支持两个按钮,在API10开始最多支持三个按钮。 |
| wantAgent |
[
WantAgent
](
#wantagent
)
| 否 | 点击通知后需要跳转的目标ability信息。 |
| wantAgent |
[
WantAgent
](
#wantagent
)
| 否 | 点击通知后需要跳转的目标ability信息。 |
| maxScreenWantAgent |
[
MaxScreenWantAgent
](
#maxscreenwantagent
)
| 否 | 提醒到达时跳转的目标包。如果设备正在使用中,则弹出一个通知框。 |
| maxScreenWantAgent |
[
MaxScreenWantAgent
](
#maxscreenwantagent
)
| 否 | 提醒到达时跳转的目标包
////
。如果设备正在使用中,则弹出一个通知框。 |
| ringDuration | number | 否 | 指明响铃时长(单位:秒),默认1秒。 |
| ringDuration | number | 否 | 指明响铃时长(单位:秒),默认1秒。 |
| snoozeTimes | number | 否 | 指明延迟提醒次数,默认0次。 |
| snoozeTimes | number | 否 | 指明延迟提醒次数,默认0次。 |
| timeInterval | number | 否 | 执行延迟提醒间隔(单位:秒),最少5分钟。 |
| timeInterval | number | 否 | 执行延迟提醒间隔(单位:秒),最少5分钟。 |
...
@@ -622,9 +624,9 @@ try {
...
@@ -622,9 +624,9 @@ try {
| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 |
| expiredContent | string | 否 | 指明提醒过期后需要显示的内容。 |
| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 |
| snoozeContent | string | 否 | 指明延迟提醒时需要显示的内容。 |
| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 |
| notificationId | number | 否 | 指明提醒使用的通知的id号,相同id号的提醒会覆盖。 |
| slotType |
[
notification.SlotType
](
js-apis-notificationManager.md#slottype
)
| 否 | 指明提醒的slot类型。 |
| slotType |
[
notification.SlotType
](
js-apis-notificationManager.md#slottype
)
| 否 | 指明提醒的slot类型。
////slot中文
|
| tapDismissed
<sup>
10+
</sup>
| boolean | 否 | 通知是否自动清除,同
[
NotificationRequest.tapDismissed
](
js-apis-inner-notification-notificationRequest.md#notificationrequest
)
。 |
| tapDismissed
<sup>
10+
</sup>
| boolean | 否 | 通知是否自动清除,同
[
NotificationRequest.tapDismissed
](
js-apis-inner-notification-notificationRequest.md#notificationrequest
)
。
////同。。是指
|
| autoDeletedTime
<sup>
10+
</sup>
| number | 否 | 自动清除的时间,同
[
NotificationRequest.autoDeletedTime
](
js-apis-inner-notification-notificationRequest.md#notificationrequest
)
。 |
| autoDeletedTime
<sup>
10+
</sup>
| number | 否 | 自动清除的时间,同
[
NotificationRequest.autoDeletedTime
](
js-apis-inner-notification-notificationRequest.md#notificationrequest
)
。
////同。。是指
|
## ReminderRequestCalendar
## ReminderRequestCalendar
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录