From 7d9fef00d006cf88e73bfe4a1cc6eea45320e9c0 Mon Sep 17 00:00:00 2001 From: Liuchy1 Date: Wed, 3 Feb 2016 14:26:28 +0800 Subject: [PATCH] fix jpush client bug --- pom.xml | 2 +- src/main/java/cn/jpush/api/JPushClient.java | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 502745bb..e6c33d62 100644 --- a/pom.xml +++ b/pom.xml @@ -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.2.7 + v3.2.8 diff --git a/src/main/java/cn/jpush/api/JPushClient.java b/src/main/java/cn/jpush/api/JPushClient.java index dbdf8feb..68aac713 100644 --- a/src/main/java/cn/jpush/api/JPushClient.java +++ b/src/main/java/cn/jpush/api/JPushClient.java @@ -138,12 +138,12 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy, ClientConfig conf, boolean apnsProduction, long timeToLive) { conf.setMaxRetryTimes(maxRetryTimes); + conf.setApnsProduction(apnsProduction); + conf.setTimeToLive(timeToLive); _pushClient = new PushClient(masterSecret, appKey, proxy, conf); _reportClient = new ReportClient(masterSecret, appKey, proxy, conf); _deviceClient = new DeviceClient(masterSecret, appKey, proxy, conf); _scheduleClient = new ScheduleClient(masterSecret, appKey, proxy, conf); - _pushClient.setDefaults(apnsProduction, timeToLive); - } /** @@ -159,7 +159,10 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr */ @Deprecated public JPushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive) { - _pushClient = new PushClient(masterSecret, appKey, apnsProduction, timeToLive); + ClientConfig conf = ClientConfig.getInstance(); + conf.setApnsProduction(apnsProduction); + conf.setTimeToLive(timeToLive); + _pushClient = new PushClient(masterSecret, appKey); _reportClient = new ReportClient(masterSecret, appKey); _deviceClient = new DeviceClient(masterSecret, appKey); _scheduleClient = new ScheduleClient(masterSecret, appKey);