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
8d3e34f1
Commit
8d3e34f1
authored
Jun 11, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统推送修改为英文
parent
eda8b90a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
common/src/main/java/com/wecloud/im/tillo/app_ws/sender/PushTask.java
+17
-13
No files found.
common/src/main/java/com/wecloud/im/tillo/app_ws/sender/PushTask.java
View file @
8d3e34f1
...
...
@@ -28,12 +28,11 @@ public class PushTask {
*/
private
static
final
String
API_URL_FCM
=
"https://fcm.googleapis.com/fcm/send"
;
//您收到一条新消息
String
title
=
"You have received a new message"
;
private
static
final
String
PUSH_TITLE
=
"You have received a new message"
;
//点击查看
String
body
=
"Click to view"
;
private
static
final
String
PUSH_BODY
=
"Click to view"
;
/**
* 异步系统推送
...
...
@@ -76,10 +75,10 @@ public class PushTask {
// 安卓 单推
String
deviceTokenIOS
=
imClientReceiver
.
getDeviceToken
();
String
titleIOS
=
title
;
String
titleIOS
=
PUSH_TITLE
;
String
subtitle
=
""
;
try
{
pushUtils
.
sendIOSUnicast
(
deviceTokenIOS
,
titleIOS
,
subtitle
,
body
);
pushUtils
.
sendIOSUnicast
(
deviceTokenIOS
,
titleIOS
,
subtitle
,
PUSH_BODY
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -107,8 +106,8 @@ public class PushTask {
JSONObject
info
=
new
JSONObject
();
info
.
put
(
"title"
,
title
);
info
.
put
(
"body"
,
body
);
info
.
put
(
"title"
,
PUSH_TITLE
);
info
.
put
(
"body"
,
PUSH_BODY
);
//数据消息data 通知消息 notification
json
.
put
(
"notification"
,
info
);
...
...
@@ -120,6 +119,9 @@ public class PushTask {
InputStreamReader
in
=
new
InputStreamReader
(
inputStream
);
BufferedReader
reader
=
new
BufferedReader
(
in
);
String
line
=
reader
.
readLine
();
log
.
debug
(
line
);
wr
.
close
();
reader
.
close
();
}
catch
(
Exception
e
)
{
...
...
@@ -148,9 +150,9 @@ public class PushTask {
// 安卓单推
String
deviceToken
=
imClientReceiver
.
getDeviceToken
();
String
unicastText
=
"Android unicast text"
;
String
unicastTicker
=
body
;
String
unicastTicker
=
PUSH_BODY
;
try
{
pushUtils
.
sendAndroidUnicast
(
deviceToken
,
unicastText
,
unicastTicker
,
title
);
pushUtils
.
sendAndroidUnicast
(
deviceToken
,
unicastText
,
unicastTicker
,
PUSH_TITLE
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -177,8 +179,8 @@ public class PushTask {
//推送到哪台客户端机器
json
.
put
(
"to"
,
imClientReceiver
.
getDeviceToken
());
JSONObject
info
=
new
JSONObject
();
info
.
put
(
"title"
,
title
);
info
.
put
(
"body"
,
body
);
info
.
put
(
"title"
,
PUSH_TITLE
);
info
.
put
(
"body"
,
PUSH_BODY
);
//数据消息data 通知消息 notification
json
.
put
(
"notification"
,
info
);
...
...
@@ -189,7 +191,10 @@ public class PushTask {
InputStream
inputStream
=
conn
.
getInputStream
();
InputStreamReader
in
=
new
InputStreamReader
(
inputStream
);
BufferedReader
reader
=
new
BufferedReader
(
in
);
// String line = null;
String
line
=
reader
.
readLine
();
log
.
debug
(
line
);
wr
.
close
();
reader
.
close
();
...
...
@@ -202,7 +207,6 @@ public class PushTask {
// apns原生:3
log
.
debug
(
"apns原生"
);
}
else
{
log
.
debug
(
"没有找到推送类型"
);
return
;
...
...
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