Skip to content

Commit 3c7bc55

Browse files
committed
Merge pull request #53 from Liuchy1/master
fix jpush client bug
2 parents bf8703a + 7d9fef0 commit 3c7bc55

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<url>https://github.com/jpush/jpush-api-java-client</url>
3636
<connection>scm:git:git@github.com:jpush/jpush-api-java-client.git</connection>
3737
<developerConnection>scm:git:git@github.com:jpush/jpush-api-java-client.git</developerConnection>
38-
<tag>v3.2.7</tag>
38+
<tag>v3.2.8</tag>
3939
</scm>
4040

4141
<dependencies>

src/main/java/cn/jpush/api/JPushClient.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
138138
public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy, ClientConfig conf,
139139
boolean apnsProduction, long timeToLive) {
140140
conf.setMaxRetryTimes(maxRetryTimes);
141+
conf.setApnsProduction(apnsProduction);
142+
conf.setTimeToLive(timeToLive);
141143
_pushClient = new PushClient(masterSecret, appKey, proxy, conf);
142144
_reportClient = new ReportClient(masterSecret, appKey, proxy, conf);
143145
_deviceClient = new DeviceClient(masterSecret, appKey, proxy, conf);
144146
_scheduleClient = new ScheduleClient(masterSecret, appKey, proxy, conf);
145-
_pushClient.setDefaults(apnsProduction, timeToLive);
146-
147147
}
148148

149149
/**
@@ -159,7 +159,10 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
159159
*/
160160
@Deprecated
161161
public JPushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive) {
162-
_pushClient = new PushClient(masterSecret, appKey, apnsProduction, timeToLive);
162+
ClientConfig conf = ClientConfig.getInstance();
163+
conf.setApnsProduction(apnsProduction);
164+
conf.setTimeToLive(timeToLive);
165+
_pushClient = new PushClient(masterSecret, appKey);
163166
_reportClient = new ReportClient(masterSecret, appKey);
164167
_deviceClient = new DeviceClient(masterSecret, appKey);
165168
_scheduleClient = new ScheduleClient(masterSecret, appKey);

0 commit comments

Comments
 (0)