diff --git a/README.md b/README.md index d4faa953..cc0150cf 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ cn.jpush.api jpush-client - 3.3.1 + 3.3.2 ``` ### jar 包方式 diff --git a/pom.xml b/pom.xml index fbb5d093..119e2537 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ cn.jpush.api jpush-client - 3.3.1-SNAPSHOT + 3.3.3-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.1 + v3.3.2 diff --git a/src/main/java/cn/jpush/api/push/model/Options.java b/src/main/java/cn/jpush/api/push/model/Options.java index 2ed0dc44..a966829c 100644 --- a/src/main/java/cn/jpush/api/push/model/Options.java +++ b/src/main/java/cn/jpush/api/push/model/Options.java @@ -14,6 +14,7 @@ public class Options implements PushModel { private static final String TIME_TO_LIVE = "time_to_live"; private static final String APNS_PRODUCTION = "apns_production"; private static final String BIG_PUSH_DURATION = "big_push_duration"; + private static final String APNS_COLLAPSE_ID = "apns_collapse_id"; private static final long NONE_TIME_TO_LIVE = -1; @@ -22,14 +23,16 @@ public class Options implements PushModel { private long timeToLive; private boolean apnsProduction; private int bigPushDuration; // minutes + private String apnsCollapseId; private Options(int sendno, long overrideMsgId, long timeToLive, boolean apnsProduction, - int bigPushDuration) { + int bigPushDuration, String apnsCollapseId) { this.sendno = sendno; this.overrideMsgId = overrideMsgId; this.timeToLive = timeToLive; this.apnsProduction = apnsProduction; this.bigPushDuration = bigPushDuration; + this.apnsCollapseId = apnsCollapseId; } public static Builder newBuilder() { @@ -78,6 +81,10 @@ public JsonElement toJSON() { if (bigPushDuration > 0) { json.add(BIG_PUSH_DURATION, new JsonPrimitive(bigPushDuration)); } + + if (apnsCollapseId != null) { + json.add(APNS_COLLAPSE_ID, new JsonPrimitive(apnsCollapseId)); + } return json; } @@ -88,6 +95,7 @@ public static class Builder { private long timeToLive = NONE_TIME_TO_LIVE; private boolean apnsProduction = false; private int bigPushDuration = 0; + private String apnsCollapseId; public Builder setSendno(int sendno) { this.sendno = sendno; @@ -108,12 +116,17 @@ public Builder setApnsProduction(boolean apnsProduction) { this.apnsProduction = apnsProduction; return this; } + + public Builder setApnsCollapseId(String id) { + this.apnsCollapseId = id; + return this; + } public Builder setBigPushDuration(int bigPushDuration) { this.bigPushDuration = bigPushDuration; return this; } - + public Options build() { Preconditions.checkArgument(sendno >= 0, "sendno should be greater than 0."); Preconditions.checkArgument(overrideMsgId >= 0, "override_msg_id should be greater than 0."); @@ -123,7 +136,7 @@ public Options build() { sendno = ServiceHelper.generateSendno(); } - return new Options(sendno, overrideMsgId, timeToLive, apnsProduction, bigPushDuration); + return new Options(sendno, overrideMsgId, timeToLive, apnsProduction, bigPushDuration, apnsCollapseId); } } diff --git a/src/test/java/cn/jpush/api/BaseTest.java b/src/test/java/cn/jpush/api/BaseTest.java index 83c5719a..f52d1bd6 100644 --- a/src/test/java/cn/jpush/api/BaseTest.java +++ b/src/test/java/cn/jpush/api/BaseTest.java @@ -5,7 +5,7 @@ public abstract class BaseTest { protected static final String APP_KEY = "d4ee2375846bc30fa51334f5"; - protected static final String MASTER_SECRET = "f88f9b289c3f681eef0b95ee"; + protected static final String MASTER_SECRET = "1bdab6d2cb99727cf768cc9c"; protected static final String GROUP_MASTER_SECRET = "b11314807507e2bcfdeebe2e"; protected static final String GROUP_PUSH_KEY = "2c88a01e073a0fe4fc7b167c"; diff --git a/src/test/java/cn/jpush/api/report/ReportFunctionTests.java b/src/test/java/cn/jpush/api/report/ReportFunctionTests.java index a1cb428c..dacf1a8e 100644 --- a/src/test/java/cn/jpush/api/report/ReportFunctionTests.java +++ b/src/test/java/cn/jpush/api/report/ReportFunctionTests.java @@ -31,7 +31,7 @@ public void getReceivedsFixed() throws Exception { @Test public void getReceivedsFixed2() throws Exception { - ReceivedsResult result = jpushClient.getReportReceiveds("1613113584, 1229760629, "); + ReceivedsResult result = jpushClient.getReportReceiveds("1613113584, 1229760629"); assertTrue(result.isResultOK()); assertTrue(result.received_list.size() > 0); }