Commit 8d3e34f1 by giaogiao

系统推送修改为英文

parent eda8b90a
...@@ -28,12 +28,11 @@ public class PushTask { ...@@ -28,12 +28,11 @@ public class PushTask {
*/ */
private static final String API_URL_FCM = "https://fcm.googleapis.com/fcm/send"; 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 { ...@@ -76,10 +75,10 @@ public class PushTask {
// 安卓 单推 // 安卓 单推
String deviceTokenIOS = imClientReceiver.getDeviceToken(); String deviceTokenIOS = imClientReceiver.getDeviceToken();
String titleIOS = title; String titleIOS = PUSH_TITLE;
String subtitle = ""; String subtitle = "";
try { try {
pushUtils.sendIOSUnicast(deviceTokenIOS, titleIOS, subtitle, body); pushUtils.sendIOSUnicast(deviceTokenIOS, titleIOS, subtitle, PUSH_BODY);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -107,8 +106,8 @@ public class PushTask { ...@@ -107,8 +106,8 @@ public class PushTask {
JSONObject info = new JSONObject(); JSONObject info = new JSONObject();
info.put("title", title); info.put("title", PUSH_TITLE);
info.put("body", body); info.put("body", PUSH_BODY);
//数据消息data 通知消息 notification //数据消息data 通知消息 notification
json.put("notification", info); json.put("notification", info);
...@@ -120,6 +119,9 @@ public class PushTask { ...@@ -120,6 +119,9 @@ public class PushTask {
InputStreamReader in = new InputStreamReader(inputStream); InputStreamReader in = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(in); BufferedReader reader = new BufferedReader(in);
String line = reader.readLine();
log.debug(line);
wr.close(); wr.close();
reader.close(); reader.close();
} catch (Exception e) { } catch (Exception e) {
...@@ -148,9 +150,9 @@ public class PushTask { ...@@ -148,9 +150,9 @@ public class PushTask {
// 安卓单推 // 安卓单推
String deviceToken = imClientReceiver.getDeviceToken(); String deviceToken = imClientReceiver.getDeviceToken();
String unicastText = "Android unicast text"; String unicastText = "Android unicast text";
String unicastTicker = body; String unicastTicker = PUSH_BODY;
try { try {
pushUtils.sendAndroidUnicast(deviceToken, unicastText, unicastTicker, title); pushUtils.sendAndroidUnicast(deviceToken, unicastText, unicastTicker, PUSH_TITLE);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -177,8 +179,8 @@ public class PushTask { ...@@ -177,8 +179,8 @@ public class PushTask {
//推送到哪台客户端机器 //推送到哪台客户端机器
json.put("to", imClientReceiver.getDeviceToken()); json.put("to", imClientReceiver.getDeviceToken());
JSONObject info = new JSONObject(); JSONObject info = new JSONObject();
info.put("title", title); info.put("title", PUSH_TITLE);
info.put("body", body); info.put("body", PUSH_BODY);
//数据消息data 通知消息 notification //数据消息data 通知消息 notification
json.put("notification", info); json.put("notification", info);
...@@ -189,7 +191,10 @@ public class PushTask { ...@@ -189,7 +191,10 @@ public class PushTask {
InputStream inputStream = conn.getInputStream(); InputStream inputStream = conn.getInputStream();
InputStreamReader in = new InputStreamReader(inputStream); InputStreamReader in = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(in); BufferedReader reader = new BufferedReader(in);
// String line = null;
String line = reader.readLine();
log.debug(line);
wr.close(); wr.close();
reader.close(); reader.close();
...@@ -202,7 +207,6 @@ public class PushTask { ...@@ -202,7 +207,6 @@ public class PushTask {
// apns原生:3 // apns原生:3
log.debug("apns原生"); log.debug("apns原生");
} else { } else {
log.debug("没有找到推送类型"); log.debug("没有找到推送类型");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment