File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
main/java/cn/jpush/api/push
test/java/cn/jpush/api/push Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 4444 < dependency>
4545 < groupId> cn. jpush. api< / groupId>
4646 < artifactId> jiguang- common< / artifactId>
47- < version> 1.1 . 0 < / version>
47+ < version> 1.1 . 1 < / version>
4848 < / dependency>
4949 < dependency>
5050 < groupId> io. netty< / groupId>
Original file line number Diff line number Diff line change 33
44 <groupId >cn.jpush.api</groupId >
55 <artifactId >jpush-client</artifactId >
6- <version >3.3.4 -SNAPSHOT</version >
6+ <version >3.3.5 -SNAPSHOT</version >
77 <packaging >jar</packaging >
88 <url >https://github.com/jpush/jpush-api-java-client</url >
99 <name >JPush API Java Client</name >
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.3.4 </tag >
38+ <tag >v3.3.5 </tag >
3939 </scm >
4040
4141 <dependencies >
4242 <dependency >
4343 <groupId >cn.jpush.api</groupId >
4444 <artifactId >jiguang-common</artifactId >
45- <version >1.0.9 </version >
45+ <version >1.1.1 </version >
4646 </dependency >
4747 <dependency >
4848 <groupId >org.apache.httpcomponents</groupId >
Original file line number Diff line number Diff line change 11package cn .jpush .api .push ;
22
3- import cn .jiguang .common .connection .IHttpClient ;
4- import cn .jiguang .common .connection .NativeHttpClient ;
5- import cn .jiguang .common .connection .NettyHttpClient ;
3+ import cn .jiguang .common .connection .*;
64import com .google .gson .JsonParseException ;
75import com .google .gson .JsonParser ;
86
97import cn .jiguang .common .ClientConfig ;
108import cn .jiguang .common .ServiceHelper ;
119import cn .jiguang .common .utils .Preconditions ;
1210import cn .jiguang .common .utils .StringUtils ;
13- import cn .jiguang .common .connection .HttpProxy ;
1411import cn .jiguang .common .resp .APIConnectionException ;
1512import cn .jiguang .common .resp .APIRequestException ;
1613import cn .jiguang .common .resp .BaseResult ;
@@ -239,6 +236,8 @@ public void setHttpClient(IHttpClient client) {
239236 public void close () {
240237 if (_httpClient != null && _httpClient instanceof NettyHttpClient ) {
241238 ((NettyHttpClient ) _httpClient ).close ();
239+ } else if (_httpClient != null && _httpClient instanceof ApacheHttpClient ) {
240+ ((ApacheHttpClient ) _httpClient ).close ();
242241 }
243242 }
244243}
Original file line number Diff line number Diff line change 88import cn .jiguang .common .connection .NettyHttpClient ;
99import cn .jiguang .common .resp .ResponseWrapper ;
1010import cn .jpush .api .JPushClient ;
11+ import cn .jpush .api .push .model .Options ;
1112import cn .jpush .api .push .model .Platform ;
1213import cn .jpush .api .push .model .audience .Audience ;
1314import cn .jpush .api .push .model .notification .*;
@@ -38,7 +39,6 @@ public void testSendPush() {
3839 PushResult result = jpushClient .sendPush (payload );
3940 int status = result .getResponseCode ();
4041 LOG .info ("Got result - " + result );
41-
4242 } catch (APIConnectionException e ) {
4343 LOG .error ("Connection error. Should retry later. " , e );
4444 LOG .error ("Sendno: " + payload .getSendno ());
@@ -77,8 +77,9 @@ public void onSucceed(ResponseWrapper responseWrapper) {
7777 public static PushPayload buildPushObject_all_alias_alert () {
7878 return PushPayload .newBuilder ()
7979 .setPlatform (Platform .all ())
80- .setAudience (Audience .alias ( "alias" ))
80+ .setAudience (Audience .registrationId ( REGISTRATION_ID3 ))
8181 .setNotification (Notification .alert (ALERT ))
82+ .setOptions (Options .newBuilder ().setApnsProduction (false ).setTimeToLive (86000 ).build ())
8283 .build ();
8384 }
8485
You can’t perform that action at this time.
0 commit comments