From 43fea3040200d3b249183f83119675f273432c1d Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期一, 28 一月 2019 10:51:24 +0800
Subject: [PATCH] 邀请关系删除失效
---
fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java | 39 +++++++++++++++++++++++++++++++--------
1 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java
index 5a7afed..e6dff06 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/push/IOSPushUtil.java
@@ -88,6 +88,16 @@
json = IOSPushFactory.createURLPush(shortUrl, info.getTitle(), info.getContent());
} else if (type == PushController.ZNX) {
json = IOSPushFactory.createZNXPush(info.getTitle(), info.getContent());
+ } else if (type == PushController.WEEX) {
+ String shortUrl = HttpUtil.getShortLink(url);
+ if (StringUtil.isNullOrEmpty(shortUrl))
+ throw new Exception("鑾峰彇鐭摼鍑洪敊");
+ json = IOSPushFactory.createWEEXPush(shortUrl, info.getTitle(), info.getContent());
+ } else if (type == PushController.BAICHUAN) {
+ String shortUrl = HttpUtil.getShortLink(url);
+ if (StringUtil.isNullOrEmpty(shortUrl))
+ throw new Exception("鑾峰彇鐭摼鍑洪敊");
+ json = IOSPushFactory.createBaiChuanPush(shortUrl, info.getTitle(), info.getContent());
}
// 鍒嗙粍鎺ㄩ�� 姣�50涓澶囦负涓�缁�
@@ -138,7 +148,12 @@
PushNotificationManager pushManager = new PushNotificationManager();
// true锛氳〃绀虹殑鏄骇鍝佺嚎涓婂彂甯冩帹閫佹湇鍔� false锛氳〃绀虹殑鏄骇鍝佹祴璇曟帹閫佹湇鍔�
- pushManager.initializeConnection(new AppleNotificationServerBasicImpl(certificate, certificatePassword, true));
+ if (Constant.IS_TEST)
+ pushManager.initializeConnection(
+ new AppleNotificationServerBasicImpl(certificate, certificatePassword, false));
+ else
+ pushManager
+ .initializeConnection(new AppleNotificationServerBasicImpl(certificate, certificatePassword, true));
List<Device> deviceList = new ArrayList<Device>();
for (String token : tokenList) {
@@ -193,19 +208,18 @@
return 4;
}
}
-
-
+
/**
* 鎵ц鎺ㄩ��
+ *
* @param tokenList
* @param json
* @throws Exception
*/
- public static void executePushIOS(List<String> tokenList, JSONObject json) throws Exception{
+ public static void executePushIOS(List<String> tokenList, JSONObject json) throws Exception {
pushIOS(tokenList, json);
}
-
-
+
/**
*
* 鏂规硶璇存槑: IOS 澶氭帹
@@ -217,8 +231,7 @@
* @return
* @throws Exception
*/
- public static JSONObject getJSONObject(MessageInfo info, String url, int type)
- throws Exception {
+ public static JSONObject getJSONObject(MessageInfo info, String url, int type) throws Exception {
// json鑷畾涔変紶鍊�
JSONObject json = null;
@@ -242,6 +255,16 @@
json = IOSPushFactory.createURLPush(shortUrl, info.getTitle(), info.getContent());
} else if (type == PushController.ZNX) {
json = IOSPushFactory.createZNXPush(info.getTitle(), info.getContent());
+ } else if (type == PushController.WEEX) {
+ String shortUrl = HttpUtil.getShortLink(url);
+ if (StringUtil.isNullOrEmpty(shortUrl))
+ shortUrl = url;
+ json = IOSPushFactory.createWEEXPush(shortUrl, info.getTitle(), info.getContent());
+ } else if (type == PushController.BAICHUAN) {
+ String shortUrl = HttpUtil.getShortLink(url);
+ if (StringUtil.isNullOrEmpty(shortUrl))
+ shortUrl = url;
+ json = IOSPushFactory.createBaiChuanPush(shortUrl, info.getTitle(), info.getContent());
}
return json;
--
Gitblit v1.8.0