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
82f96153
Commit
82f96153
authored
Jan 12, 2022
by
hweeeeeei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
允许客户端自定义系统推送内容,消息model-push中添加"data"参数为自定义数据,可以为json或字符串
parent
6fdcff36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
+4
-1
No files found.
common/src/main/java/com/wecloud/im/ws/sender/PushTask.java
View file @
82f96153
...
@@ -223,7 +223,7 @@ public class PushTask {
...
@@ -223,7 +223,7 @@ public class PushTask {
// 自定义推送字段
// 自定义推送字段
Map
<
String
,
String
>
dataMap
=
new
HashMap
<>();
Map
<
String
,
String
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"data"
,
pushModel
.
getData
());
dataMap
.
put
(
"data"
,
pushModel
.
getData
());
info
.
put
(
"data"
,
dataMap
);
json
.
put
(
"data"
,
dataMap
);
//数据消息data 通知消息 notification
//数据消息data 通知消息 notification
json
.
put
(
"notification"
,
info
);
json
.
put
(
"notification"
,
info
);
...
@@ -232,6 +232,9 @@ public class PushTask {
...
@@ -232,6 +232,9 @@ public class PushTask {
OutputStreamWriter
wr
=
new
OutputStreamWriter
(
conn
.
getOutputStream
());
OutputStreamWriter
wr
=
new
OutputStreamWriter
(
conn
.
getOutputStream
());
jsonStr
=
json
.
toString
();
jsonStr
=
json
.
toString
();
log
.
info
(
"FCM push data {}"
,
jsonStr
);
wr
.
write
(
jsonStr
);
wr
.
write
(
jsonStr
);
wr
.
flush
();
wr
.
flush
();
InputStream
inputStream
=
conn
.
getInputStream
();
InputStream
inputStream
=
conn
.
getInputStream
();
...
...
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