Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
490afd75
Commit
490afd75
authored
Jan 11, 2022
by
hweeeeeei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
允许客户端自定义系统推送内容,消息model-push中添加"data"参数为自定义数据,可以为json或字符串
parent
a90e5c83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
+6
-1
开发记录.md
+2
-1
No files found.
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
View file @
490afd75
...
...
@@ -219,11 +219,16 @@ public class PushTask {
JSONObject
info
=
new
JSONObject
();
info
.
put
(
"title"
,
pushModel
.
getTitle
());
info
.
put
(
"body"
,
pushModel
.
getSubTitle
());
// 自定义推送字段
Map
<
String
,
String
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"data"
,
pushModel
.
getData
());
info
.
put
(
"data"
,
dataMap
);
//数据消息data 通知消息 notification
json
.
put
(
"notification"
,
info
);
// 自定义推送内容
json
.
put
(
"data"
,
pushModel
.
getData
());
OutputStreamWriter
wr
=
new
OutputStreamWriter
(
conn
.
getOutputStream
());
jsonStr
=
json
.
toString
();
...
...
开发记录.md
View file @
490afd75
...
...
@@ -44,6 +44,7 @@ aaaaa3
"push":{
"title":"收到一条新消息",
"subTitle":"发给12312123213这是一123个纯文本消息,发给12312123213这是一123个纯文本消息发给12312123213这是一123个纯文本消息"
"data":""
},
"diyAbcd":"aaaa自已定义字段的值",
"toConversation":1427910060675305472,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment