Skip to content

Commit 74d2e5d

Browse files
authored
Merge pull request #92 from jpush/dev
Dev
2 parents 7fc2b03 + db012b1 commit 74d2e5d

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>cn.jpush.api</groupId>
2828
<artifactId>jpush-client</artifactId>
29-
<version>3.3.1</version>
29+
<version>3.3.2</version>
3030
</dependency>
3131
```
3232
### jar 包方式

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>cn.jpush.api</groupId>
55
<artifactId>jpush-client</artifactId>
6-
<version>3.3.1-SNAPSHOT</version>
6+
<version>3.3.3-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<url>https://github.com/jpush/jpush-api-java-client</url>
99
<name>JPush API Java Client</name>
@@ -35,7 +35,7 @@
3535
<url>https://github.com/jpush/jpush-api-java-client</url>
3636
<connection>scm:git:[email protected]:jpush/jpush-api-java-client.git</connection>
3737
<developerConnection>scm:git:[email protected]:jpush/jpush-api-java-client.git</developerConnection>
38-
<tag>v3.3.1</tag>
38+
<tag>v3.3.2</tag>
3939
</scm>
4040

4141
<dependencies>

src/main/java/cn/jpush/api/push/model/Options.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class Options implements PushModel {
1414
private static final String TIME_TO_LIVE = "time_to_live";
1515
private static final String APNS_PRODUCTION = "apns_production";
1616
private static final String BIG_PUSH_DURATION = "big_push_duration";
17+
private static final String APNS_COLLAPSE_ID = "apns_collapse_id";
1718

1819
private static final long NONE_TIME_TO_LIVE = -1;
1920

@@ -22,14 +23,16 @@ public class Options implements PushModel {
2223
private long timeToLive;
2324
private boolean apnsProduction;
2425
private int bigPushDuration; // minutes
26+
private String apnsCollapseId;
2527

2628
private Options(int sendno, long overrideMsgId, long timeToLive, boolean apnsProduction,
27-
int bigPushDuration) {
29+
int bigPushDuration, String apnsCollapseId) {
2830
this.sendno = sendno;
2931
this.overrideMsgId = overrideMsgId;
3032
this.timeToLive = timeToLive;
3133
this.apnsProduction = apnsProduction;
3234
this.bigPushDuration = bigPushDuration;
35+
this.apnsCollapseId = apnsCollapseId;
3336
}
3437

3538
public static Builder newBuilder() {
@@ -78,6 +81,10 @@ public JsonElement toJSON() {
7881
if (bigPushDuration > 0) {
7982
json.add(BIG_PUSH_DURATION, new JsonPrimitive(bigPushDuration));
8083
}
84+
85+
if (apnsCollapseId != null) {
86+
json.add(APNS_COLLAPSE_ID, new JsonPrimitive(apnsCollapseId));
87+
}
8188

8289
return json;
8390
}
@@ -88,6 +95,7 @@ public static class Builder {
8895
private long timeToLive = NONE_TIME_TO_LIVE;
8996
private boolean apnsProduction = false;
9097
private int bigPushDuration = 0;
98+
private String apnsCollapseId;
9199

92100
public Builder setSendno(int sendno) {
93101
this.sendno = sendno;
@@ -108,12 +116,17 @@ public Builder setApnsProduction(boolean apnsProduction) {
108116
this.apnsProduction = apnsProduction;
109117
return this;
110118
}
119+
120+
public Builder setApnsCollapseId(String id) {
121+
this.apnsCollapseId = id;
122+
return this;
123+
}
111124

112125
public Builder setBigPushDuration(int bigPushDuration) {
113126
this.bigPushDuration = bigPushDuration;
114127
return this;
115128
}
116-
129+
117130
public Options build() {
118131
Preconditions.checkArgument(sendno >= 0, "sendno should be greater than 0.");
119132
Preconditions.checkArgument(overrideMsgId >= 0, "override_msg_id should be greater than 0.");
@@ -123,7 +136,7 @@ public Options build() {
123136
sendno = ServiceHelper.generateSendno();
124137
}
125138

126-
return new Options(sendno, overrideMsgId, timeToLive, apnsProduction, bigPushDuration);
139+
return new Options(sendno, overrideMsgId, timeToLive, apnsProduction, bigPushDuration, apnsCollapseId);
127140
}
128141
}
129142

src/test/java/cn/jpush/api/BaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public abstract class BaseTest {
66

77
protected static final String APP_KEY = "d4ee2375846bc30fa51334f5";
8-
protected static final String MASTER_SECRET = "f88f9b289c3f681eef0b95ee";
8+
protected static final String MASTER_SECRET = "1bdab6d2cb99727cf768cc9c";
99
protected static final String GROUP_MASTER_SECRET = "b11314807507e2bcfdeebe2e";
1010
protected static final String GROUP_PUSH_KEY = "2c88a01e073a0fe4fc7b167c";
1111

src/test/java/cn/jpush/api/report/ReportFunctionTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void getReceivedsFixed() throws Exception {
3131

3232
@Test
3333
public void getReceivedsFixed2() throws Exception {
34-
ReceivedsResult result = jpushClient.getReportReceiveds("1613113584, 1229760629, ");
34+
ReceivedsResult result = jpushClient.getReportReceiveds("1613113584, 1229760629");
3535
assertTrue(result.isResultOK());
3636
assertTrue(result.received_list.size() > 0);
3737
}

0 commit comments

Comments
 (0)