Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
cb4fc2f5
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
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看板
提交
cb4fc2f5
编写于
2月 04, 2023
作者:
zyjhandsome
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
发送通知的notificationRequest参数增加notificationManager.NotificationRequest类型
Signed-off-by:
zyjhandsome
<
zyjhandsome@126.com
>
上级
21c5734a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
zh-cn/application-dev/notification/notification-with-wantagent.md
...plication-dev/notification/notification-with-wantagent.md
+1
-1
zh-cn/application-dev/notification/progress-bar-notification.md
...application-dev/notification/progress-bar-notification.md
+1
-1
zh-cn/application-dev/notification/text-notification.md
zh-cn/application-dev/notification/text-notification.md
+4
-4
zh-cn/application-dev/reference/apis/js-apis-notificationManager.md
...ication-dev/reference/apis/js-apis-notificationManager.md
+4
-4
未找到文件。
zh-cn/application-dev/notification/notification-with-wantagent.md
浏览文件 @
cb4fc2f5
...
...
@@ -96,7 +96,7 @@
```
typescript
// 构造NotificationRequest对象
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
normal
:
{
...
...
zh-cn/application-dev/notification/progress-bar-notification.md
浏览文件 @
cb4fc2f5
...
...
@@ -45,7 +45,7 @@
4.
构造进度条模板对象,并发布通知。
```
ts
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
zh-cn/application-dev/notification/text-notification.md
浏览文件 @
cb4fc2f5
...
...
@@ -45,7 +45,7 @@
-
普通文本类型通知由标题、文本内容和附加信息三个字段组成,其中标题和文本内容是必填字段,大小均需要小于200字节。
```
ts
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
// 普通文本类型通知
...
...
@@ -71,7 +71,7 @@
-
长文本类型通知继承了普通文本类型的字段,同时新增了长文本内容、内容概要和通知展开时的标题,其中长文本内容不超过1024字节,其他字段小于200字节。通知默认显示与普通文本相同,展开后,标题显示为展开后标题内容,内容为长文本内容。
```
ts
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_LONG_TEXT
,
// 长文本类型通知
...
...
@@ -101,7 +101,7 @@
-
多行文本类型通知继承了普通文本类型的字段,同时新增了多行文本内容、内容概要和通知展开时的标题,其字段均小于200字节。通知默认显示与普通文本相同,展开后,标题显示为展开后标题内容,多行文本内容多行显示。
```
ts
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_MULTILINE
,
// 多行文本类型通知
...
...
@@ -131,7 +131,7 @@
```
ts
let
notificationPicture
:
PixelMap
=
undefined
;
// 需要获取图片PixelMap信息
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_PICTURE
,
...
...
zh-cn/application-dev/reference/apis/js-apis-notificationManager.md
浏览文件 @
cb4fc2f5
...
...
@@ -50,7 +50,7 @@ function publishCallback(err) {
}
}
//通知Request对象
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
@@ -93,7 +93,7 @@ publish(request: NotificationRequest): Promise\<void\>
```
ts
// 通知Request对象
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
notificationId
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
@@ -156,7 +156,7 @@ function publishCallback(err) {
// 用户ID
let
userId
=
1
;
// 通知Request对象
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
id
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
@@ -204,7 +204,7 @@ publish(request: NotificationRequest, userId: number): Promise\<void\>
**示例:**
```
ts
let
notificationRequest
=
{
let
notificationRequest
:
notificationManager
.
NotificationRequest
=
{
notificationId
:
1
,
content
:
{
contentType
:
notificationManager
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录