Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
35db91ec
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看板
提交
35db91ec
编写于
6月 24, 2022
作者:
X
xuzhihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix issues of Notiofication docs
Signed-off-by:
N
xuzhihao
<
xuzhihao16@huawei.com
>
上级
e9f0bae3
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
440 addition
and
16 deletion
+440
-16
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
+14
-7
zh-cn/application-dev/reference/apis/js-apis-emitter.md
zh-cn/application-dev/reference/apis/js-apis-emitter.md
+13
-7
zh-cn/application-dev/reference/apis/js-apis-notification.md
zh-cn/application-dev/reference/apis/js-apis-notification.md
+411
-2
zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md
...n/application-dev/reference/apis/js-apis-reminderAgent.md
+2
-0
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-commonEvent.md
浏览文件 @
35db91ec
...
@@ -3,9 +3,17 @@
...
@@ -3,9 +3,17 @@
>  **说明:**
>  **说明:**
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## support
## 导入模块
```
js
import
CommonEvent
from
'
@ohos.commonEvent
'
;
```
## Support
CommonEvent模块支持的事件类型。名称指的是系统公共事件宏;值指的是系统公共事件。
|
系统公共事件宏 | 系统公共事件名称
| 订阅者所需权限 | 说明 |
|
名称 | 值
| 订阅者所需权限 | 说明 |
| ------------ | ------------------ | ---------------------- | -------------------- |
| ------------ | ------------------ | ---------------------- | -------------------- |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 指示用户已完成引导并加载系统的公共事件的操作。 |
| COMMON_EVENT_BOOT_COMPLETED | usual.event.BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 指示用户已完成引导并加载系统的公共事件的操作。 |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 表示用户已完成引导,系统已加载,但屏幕仍锁定的公共事件的操作。 |
| COMMON_EVENT_LOCKED_BOOT_COMPLETED | usual.event.LOCKED_BOOT_COMPLETED | ohos.permission.RECEIVER_STARTUP_COMPLETED | 表示用户已完成引导,系统已加载,但屏幕仍锁定的公共事件的操作。 |
...
@@ -158,11 +166,6 @@
...
@@ -158,11 +166,6 @@
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | 无 | 表示设备飞行模式已更改的公共事件的动作。 |
| COMMON_EVENT_AIRPLANE_MODE_CHANGED | usual.event.AIRPLANE_MODE | 无 | 表示设备飞行模式已更改的公共事件的动作。 |
| COMMON_EVENT_SPLIT_SCREEN | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | 表示分屏的公共事件的动作。 |
| COMMON_EVENT_SPLIT_SCREEN | usual.event.SPLIT_SCREEN | ohos.permission.RECEIVER_SPLIT_SCREEN | 表示分屏的公共事件的动作。 |
## 导入模块
```
js
import
CommonEvent
from
'
@ohos.commonEvent
'
;
```
## CommonEvent.publish
## CommonEvent.publish
...
@@ -172,6 +175,8 @@ publish(event: string, callback: AsyncCallback\<void>): void
...
@@ -172,6 +175,8 @@ publish(event: string, callback: AsyncCallback\<void>): void
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
...
@@ -205,6 +210,8 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\
...
@@ -205,6 +210,8 @@ publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统能力:**
SystemCapability.Notification.CommonEvent
**系统API**
: 此接口为系统接口,三方应用不支持调用。
**参数:**
**参数:**
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
| 名称 | 读写属性 | 类型 | 必填 | 描述 |
...
...
zh-cn/application-dev/reference/apis/js-apis-emitter.md
浏览文件 @
35db91ec
...
@@ -16,12 +16,14 @@ import emitter from '@ohos.events.emitter'
...
@@ -16,12 +16,14 @@ import emitter from '@ohos.events.emitter'
用于表示事件被投递的优先级。
用于表示事件被投递的优先级。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 值 | 说明 |
| 名称 | 值 | 说明 |
| --------- | ---- | ------------------------------------------------- |
| --------- | ---- | ------------------------------------------------- |
| IMMEDIATE | 0 | 表示事件被立即投递。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| IMMEDIATE | 0 | 表示事件被立即投递。 |
| HIGH | 1 | 表示事件先于LOW优先级投递。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| HIGH | 1 | 表示事件先于LOW优先级投递。 |
| LOW | 2 | 表示事件优于IDLE优先级投递,事件的默认优先级是LOW。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| LOW | 2 | 表示事件优于IDLE优先级投递,事件的默认优先级是LOW。
|
| IDLE | 3 | 表示在没有其他事件的情况下,才投递该事件。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| IDLE | 3 | 表示在没有其他事件的情况下,才投递该事件。
|
## emitter.on
## emitter.on
...
@@ -131,15 +133,19 @@ emitter.emit(innerEvent, eventData);
...
@@ -131,15 +133,19 @@ emitter.emit(innerEvent, eventData);
进程内的事件。
进程内的事件。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| -------- | ------------------------------- | ---- | ---- | ---------------------------------- |
| eventId | number | 是 | 是 | 事件的ID,由开发者定义用来辨别事件。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| eventId | number | 是 | 是 | 事件的ID,由开发者定义用来辨别事件。 |
| priority |
[
EventPriority
](
#eventpriority
)
| 是 | 是 | 事件被投递的优先级。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| priority |
[
EventPriority
](
#eventpriority
)
| 是 | 是 | 事件被投递的优先级。 |
## EventData
## EventData
发送事件时传递的数据。
发送事件时传递的数据。
**系统能力**
: 以下各项对应的系统能力均为 SystemCapability.Notification.Emitter
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ---- | ------------------ | ---- | ---- | -------------- |
| ---- | ------------------ | ---- | ---- | -------------- |
| data | [key: string]: any | 是 | 是 | 发送事件时传递的数据,数据类型支持字符串、整型和布尔型。
<br/>
**系统能力**
: SystemCapability.Notification.Emitter
|
| data | [key: string]: any | 是 | 是 | 发送事件时传递的数据,数据类型支持字符串、整型和布尔型。 |
zh-cn/application-dev/reference/apis/js-apis-notification.md
浏览文件 @
35db91ec
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md
浏览文件 @
35db91ec
...
@@ -50,6 +50,8 @@ publishReminder(reminderReq: ReminderRequest): Promise<number>
...
@@ -50,6 +50,8 @@ publishReminder(reminderReq: ReminderRequest): Promise<number>
发布一个后台代理提醒,使用Promise方式实现异步调用。
发布一个后台代理提醒,使用Promise方式实现异步调用。
**需要权限**
: ohos.permission.PUBLISH_AGENT_REMINDER
**系统能力**
: SystemCapability.Notification.ReminderAgent
**系统能力**
: SystemCapability.Notification.ReminderAgent
**参数**
:
**参数**
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录