From 31a7e0951005ee40be986ec52bb7cd9c3433b39d Mon Sep 17 00:00:00 2001 From: KenChoi Date: Mon, 29 Jan 2018 17:56:09 +0800 Subject: [PATCH 1/2] prepare release 3.3.4 --- README.md | 4 ++-- pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0a2483f9..69f5f206 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ cn.jpush.api jpush-client - 3.3.3 + 3.3.4 ``` ### jar 包方式 @@ -44,7 +44,7 @@ cn.jpush.api jiguang-common - 1.0.8 + 1.1.0 io.netty diff --git a/pom.xml b/pom.xml index d581c063..3cb3a07b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ cn.jpush.api jpush-client - 3.3.3-SNAPSHOT + 3.3.4-SNAPSHOT jar https://github.com/jpush/jpush-api-java-client JPush API Java Client @@ -35,7 +35,7 @@ https://github.com/jpush/jpush-api-java-client scm:git:git@github.com:jpush/jpush-api-java-client.git scm:git:git@github.com:jpush/jpush-api-java-client.git - v3.3.3 + v3.3.4 From 909dd57f3f3815a539fa0f321a12b94158fd47f3 Mon Sep 17 00:00:00 2001 From: KenChoi Date: Mon, 12 Feb 2018 15:07:15 +0800 Subject: [PATCH 2/2] prepare release v3.3.5 --- README.md | 2 +- pom.xml | 6 +++--- src/main/java/cn/jpush/api/push/PushClient.java | 7 +++---- src/test/java/cn/jpush/api/push/PushClientTest.java | 5 +++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 69f5f206..af9bdaee 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ cn.jpush.api jiguang-common - 1.1.0 + 1.1.1 io.netty diff --git a/pom.xml b/pom.xml index 3cb3a07b..bb8b67af 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ cn.jpush.api jpush-client - 3.3.4-SNAPSHOT + 3.3.5-SNAPSHOT jar https://github.com/jpush/jpush-api-java-client JPush API Java Client @@ -35,14 +35,14 @@ https://github.com/jpush/jpush-api-java-client scm:git:git@github.com:jpush/jpush-api-java-client.git scm:git:git@github.com:jpush/jpush-api-java-client.git - v3.3.4 + v3.3.5 cn.jpush.api jiguang-common - 1.0.9 + 1.1.1 org.apache.httpcomponents diff --git a/src/main/java/cn/jpush/api/push/PushClient.java b/src/main/java/cn/jpush/api/push/PushClient.java index fda45227..31ecd7e8 100644 --- a/src/main/java/cn/jpush/api/push/PushClient.java +++ b/src/main/java/cn/jpush/api/push/PushClient.java @@ -1,8 +1,6 @@ package cn.jpush.api.push; -import cn.jiguang.common.connection.IHttpClient; -import cn.jiguang.common.connection.NativeHttpClient; -import cn.jiguang.common.connection.NettyHttpClient; +import cn.jiguang.common.connection.*; import com.google.gson.JsonParseException; import com.google.gson.JsonParser; @@ -10,7 +8,6 @@ import cn.jiguang.common.ServiceHelper; import cn.jiguang.common.utils.Preconditions; import cn.jiguang.common.utils.StringUtils; -import cn.jiguang.common.connection.HttpProxy; import cn.jiguang.common.resp.APIConnectionException; import cn.jiguang.common.resp.APIRequestException; import cn.jiguang.common.resp.BaseResult; @@ -239,6 +236,8 @@ public void setHttpClient(IHttpClient client) { public void close() { if (_httpClient != null && _httpClient instanceof NettyHttpClient) { ((NettyHttpClient) _httpClient).close(); + } else if (_httpClient != null && _httpClient instanceof ApacheHttpClient) { + ((ApacheHttpClient) _httpClient).close(); } } } diff --git a/src/test/java/cn/jpush/api/push/PushClientTest.java b/src/test/java/cn/jpush/api/push/PushClientTest.java index 76177893..560ac4be 100644 --- a/src/test/java/cn/jpush/api/push/PushClientTest.java +++ b/src/test/java/cn/jpush/api/push/PushClientTest.java @@ -8,6 +8,7 @@ import cn.jiguang.common.connection.NettyHttpClient; import cn.jiguang.common.resp.ResponseWrapper; import cn.jpush.api.JPushClient; +import cn.jpush.api.push.model.Options; import cn.jpush.api.push.model.Platform; import cn.jpush.api.push.model.audience.Audience; import cn.jpush.api.push.model.notification.*; @@ -38,7 +39,6 @@ public void testSendPush() { PushResult result = jpushClient.sendPush(payload); int status = result.getResponseCode(); LOG.info("Got result - " + result); - } catch (APIConnectionException e) { LOG.error("Connection error. Should retry later. ", e); LOG.error("Sendno: " + payload.getSendno()); @@ -77,8 +77,9 @@ public void onSucceed(ResponseWrapper responseWrapper) { public static PushPayload buildPushObject_all_alias_alert() { return PushPayload.newBuilder() .setPlatform(Platform.all()) - .setAudience(Audience.alias("alias")) + .setAudience(Audience.registrationId(REGISTRATION_ID3)) .setNotification(Notification.alert(ALERT)) + .setOptions(Options.newBuilder().setApnsProduction(false).setTimeToLive(86000).build()) .build(); }