diff --git a/README.md b/README.md
index 40c55d37..185e9c2e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,15 @@
+# 新版 SDK
+欢迎使用新一代 [jiguang-sdk-java](https://github.com/jpush/jiguang-sdk-java)!这个 SDK 旨在提供更好的性能、更多功能和更好的用户体验。
+
+为什么升级?
+* 性能优化:新版本经过优化,运行更快,消耗更少的资源。
+* 功能增强:引入了许多新功能和改进,使您的开发工作更加高效。
+* Bug 修复:解决了上个版本存在的问题,提高了稳定性和可靠性。
+
+> 极光已推出新版本的 SDK 供广大用户使用,当前版本后续将不推荐使用,请移步仓库 [jiguang-sdk-java](https://github.com/jpush/jiguang-sdk-java) 了解更多。
+
+# ~~旧版 SDK~~
+
[](http://badge.fury.io/gh/jpush%2Fjpush-api-java-client)
# JPush API Java Library
diff --git a/pom.xml b/pom.xml
index 65d76ebb..7a3330df 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,25 +3,17 @@
cn.jpush.apijpush-client
- 3.5.2
+ 3.7.8jarhttps://github.com/jpush/jpush-api-java-clientJPush API Java ClientJPush's officially supported Java client library for accessing JPush APIs.
-
-
- The Apache Software License, Version 2.0
- http://www.apache.org/licenses/LICENSE-2.0.txt
- repo
-
-
-
githubUTF-8
- 1.7
- 1.7
+ 1.6
+ 1.6
@@ -51,7 +43,7 @@
cn.jpush.apijiguang-common
- 1.1.11
+ 1.2.7org.apache.httpcomponents
@@ -108,7 +100,7 @@
junitjunit
- 4.11
+ 4.13.1test
@@ -131,218 +123,4 @@
-
-
-
- maven-compiler-plugin
- 3.1
-
- ${jdkVersion}
- ${jdkVersion}
- 1.5
- true
- true
- true
- true
-
- -Xlint:unchecked
-
-
-
-
-
- org.apache.maven.plugins
- maven-release-plugin
- 2.5.1
-
-
- org.apache.maven.plugins
- maven-scm-plugin
- 1.9.2
-
-
-
- deploy,site
- false
- true
- true
- v@{project.version}
-
-
-
-
- com.github.github
- site-maven-plugin
- 0.9
-
- Creating site for ${project.version}
- github
-
-
-
-
- site
-
- site
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.17
-
- cn.jpush.api.FastTests
- -Dfile.encoding=UTF-8
-
- **/mock/*Test.java
-
-
-
-
- org.apache.maven.surefire
- surefire-junit47
- 2.17
-
-
-
-
-
- org.apache.maven.plugins
- maven-failsafe-plugin
- 2.17
-
- UTF-8
- cn.jpush.api.SlowTests
- -Dfile.encoding=UTF-8
-
- **/mock/*Test.java
-
-
-
-
-
- integration-test
- verify
-
-
-
- **/*.class
-
-
-
-
-
-
- org.apache.maven.surefire
- surefire-junit47
- 2.17
-
-
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.9.1
-
-
- attach-javadocs
-
- jar
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-gpg-plugin
- 1.5
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.7
- true
-
- ossrh
- https://oss.sonatype.org/
-
- false
-
-
-
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots/
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-project-info-reports-plugin
- 2.8
-
-
-
- dependencies
- license
- scm
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.10.3
-
- resources/javadoc-overview.html
-
-
-
-
-
-
diff --git a/src/main/java/cn/jpush/api/JPushClient.java b/src/main/java/cn/jpush/api/JPushClient.java
index ea4a7dd3..e0b132b7 100644
--- a/src/main/java/cn/jpush/api/JPushClient.java
+++ b/src/main/java/cn/jpush/api/JPushClient.java
@@ -7,6 +7,7 @@
import cn.jiguang.common.resp.*;
import cn.jpush.api.push.CIDResult;
import cn.jpush.api.push.model.*;
+import cn.jpush.api.push.model.live_activity.LiveActivity;
import cn.jpush.api.report.*;
import cn.jpush.api.report.model.CheckMessagePayload;
import com.google.gson.JsonObject;
@@ -38,30 +39,30 @@
*/
public class JPushClient {
private final PushClient _pushClient;
- private final ReportClient _reportClient;
- private final DeviceClient _deviceClient;
+ private final ReportClient _reportClient;
+ private final DeviceClient _deviceClient;
private final ScheduleClient _scheduleClient;
-
- /**
- * Create a JPush Client.
- *
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
- */
- public JPushClient(String masterSecret, String appKey) {
- _pushClient = new PushClient(masterSecret, appKey);
- _reportClient = new ReportClient(masterSecret, appKey);
- _deviceClient = new DeviceClient(masterSecret, appKey);
+
+ /**
+ * Create a JPush Client.
+ *
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
+ */
+ public JPushClient(String masterSecret, String appKey) {
+ _pushClient = new PushClient(masterSecret, appKey);
+ _reportClient = new ReportClient(masterSecret, appKey);
+ _deviceClient = new DeviceClient(masterSecret, appKey);
_scheduleClient = new ScheduleClient(masterSecret, appKey);
- }
+ }
/**
* Create a JPush Client by custom Client configuration.
*
* @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
- * @param proxy The proxy, if there is no proxy, should be null.
- * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
+ * @param appKey The KEY of one application on JPush.
+ * @param proxy The proxy, if there is no proxy, should be null.
+ * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
*/
public JPushClient(String masterSecret, String appKey, HttpProxy proxy, ClientConfig conf) {
_pushClient = new PushClient(masterSecret, appKey, proxy, conf);
@@ -72,24 +73,26 @@ public JPushClient(String masterSecret, String appKey, HttpProxy proxy, ClientCo
/**
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
+ *
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
* @param maxRetryTimes The max retry times.
*/
@Deprecated
- public JPushClient(String masterSecret, String appKey, int maxRetryTimes) {
+ public JPushClient(String masterSecret, String appKey, int maxRetryTimes) {
_pushClient = new PushClient(masterSecret, appKey, maxRetryTimes);
_reportClient = new ReportClient(masterSecret, appKey, maxRetryTimes);
_deviceClient = new DeviceClient(masterSecret, appKey, maxRetryTimes);
_scheduleClient = new ScheduleClient(masterSecret, appKey, maxRetryTimes);
- }
+ }
/**
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
+ *
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
* @param maxRetryTimes The max retry times.
- * @param proxy The proxy, if there is no proxy, should be null.
+ * @param proxy The proxy, if there is no proxy, should be null.
*/
@Deprecated
public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
@@ -98,18 +101,18 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
_deviceClient = new DeviceClient(masterSecret, appKey, maxRetryTimes, proxy);
_scheduleClient = new ScheduleClient(masterSecret, appKey, maxRetryTimes, proxy);
}
-
+
/**
* Create a JPush Client by custom Client configuration.
- *
+ *
* If you are using JPush privacy cloud, maybe this constructor is what you needed.
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setMaxRetryTimes} instead of this constructor.
*
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
* @param maxRetryTimes Client request retry times.
- * @param proxy The proxy, if there is no proxy, should be null.
- * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
+ * @param proxy The proxy, if there is no proxy, should be null.
+ * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
*/
@Deprecated
public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy, ClientConfig conf) {
@@ -124,18 +127,18 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
/**
* Create a JPush Client by custom Client configuration with global settings.
- *
+ *
* If you are using JPush privacy cloud, and you want different settings from default globally,
* maybe this constructor is what you needed.
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setGlobalPushSetting} instead of this constructor.
*
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
- * @param maxRetryTimes Client request retry times.
- * @param proxy The proxy, if there is no proxy, should be null.
- * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
+ * @param maxRetryTimes Client request retry times.
+ * @param proxy The proxy, if there is no proxy, should be null.
+ * @param conf The client configuration. Can use ClientConfig.getInstance() as default.
* @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
- * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
+ * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
*/
@Deprecated
public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy, ClientConfig conf,
@@ -148,18 +151,18 @@ public JPushClient(String masterSecret, String appKey, int maxRetryTimes, HttpPr
_deviceClient = new DeviceClient(masterSecret, appKey, proxy, conf);
_scheduleClient = new ScheduleClient(masterSecret, appKey, proxy, conf);
}
-
- /**
- * Create a JPush Client with global settings.
- *
- * If you want different settings from default globally, this constructor is what you needed.
- * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setGlobalPushSetting} instead of this constructor.
+
+ /**
+ * Create a JPush Client with global settings.
+ *
+ * If you want different settings from default globally, this constructor is what you needed.
+ * This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig#setGlobalPushSetting} instead of this constructor.
*
- * @param masterSecret API access secret of the appKey.
- * @param appKey The KEY of one application on JPush.
- * @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
- * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
- */
+ * @param masterSecret API access secret of the appKey.
+ * @param appKey The KEY of one application on JPush.
+ * @param apnsProduction Global APNs environment setting. It will override PushPayload Options.
+ * @param timeToLive Global time_to_live setting. It will override PushPayload Options.
+ */
@Deprecated
public JPushClient(String masterSecret, String appKey, boolean apnsProduction, long timeToLive) {
ClientConfig conf = ClientConfig.getInstance();
@@ -179,28 +182,28 @@ public PushClient getPushClient() {
/**
* Send a push with PushPayload object.
- *
- * @param pushPayload payload object of a push.
+ *
+ * @param pushPayload payload object of a push.
* @return PushResult The result object of a Push. Can be printed to a JSON.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
- public PushResult sendPush(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
- return _pushClient.sendPush(pushPayload);
- }
-
- /**
- * Send a push with JSON string.
- *
- * You can send a push JSON string directly with this method.
- *
- * Attention: globally settings cannot be affect this type of Push.
- *
- * @param payloadString payload of a push.
+ public PushResult sendPush(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
+ return _pushClient.sendPush(pushPayload);
+ }
+
+ /**
+ * Send a push with JSON string.
+ *
+ * You can send a push JSON string directly with this method.
+ *
+ * Attention: globally settings cannot be affect this type of Push.
+ *
+ * @param payloadString payload of a push.
* @return PushResult. Can be printed to a JSON.
- * @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
- */
+ * @throws APIConnectionException if a remote or network exception occurs.
+ * @throws APIRequestException if a request exception occurs.
+ */
public PushResult sendPush(String payloadString) throws APIConnectionException, APIRequestException {
return _pushClient.sendPush(payloadString);
}
@@ -211,26 +214,26 @@ public PushResult sendPush(String payloadString) throws APIConnectionException,
* @param pushPayload payload object of a push.
* @return PushResult The result object of a Push. Can be printed to a JSON.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendFilePush(PushPayload pushPayload) throws APIConnectionException, APIRequestException {
return _pushClient.sendFilePush(pushPayload);
}
-
+
/**
* Validate a push action, but do NOT send it actually.
- *
+ *
* @param payload payload of a push.
* @return PushResult. Can be printed to a JSON.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendPushValidate(PushPayload payload) throws APIConnectionException, APIRequestException {
- return _pushClient.sendPushValidate(payload);
+ return _pushClient.sendPushValidate(payload);
}
public PushResult sendPushValidate(String payloadString) throws APIConnectionException, APIRequestException {
- return _pushClient.sendPushValidate(payloadString);
+ return _pushClient.sendPushValidate(payloadString);
}
public BatchPushResult batchSendPushByRegId(List pushPayloadList) throws APIConnectionException, APIRequestException {
@@ -243,35 +246,36 @@ public BatchPushResult batchSendPushByAlias(List pushPayloadList) t
/**
* Get cid list, the data form of cid is appKey-uuid.
+ *
* @param count the count of cid list, from 1 to 1000. default is 1.
- * @param type default is push, option: schedule
+ * @param type default is push, option: schedule
* @return CIDResult, an array of cid
* @throws APIConnectionException connect exception
- * @throws APIRequestException request exception
+ * @throws APIRequestException request exception
*/
public CIDResult getCidList(int count, String type) throws APIConnectionException, APIRequestException {
return _pushClient.getCidList(count, type);
}
-
+
// ------------------------------- Report API
/**
- * Get received report.
- *
+ * Get received report.
+ *
* @param msgIds 100 msgids to batch getting is supported.
* @return ReceivedResult. Can be printed to JSON.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ReceivedsResult getReportReceiveds(String msgIds) throws APIConnectionException, APIRequestException {
- return _reportClient.getReceiveds(msgIds);
- }
-
+ return _reportClient.getReceiveds(msgIds);
+ }
+
public UsersResult getReportUsers(TimeUnit timeUnit, String start, int duration) throws APIConnectionException, APIRequestException {
return _reportClient.getUsers(timeUnit, start, duration);
}
-
+
public MessagesResult getReportMessages(String msgIds) throws APIConnectionException, APIRequestException {
return _reportClient.getMessages(msgIds);
}
@@ -300,7 +304,7 @@ public GroupUsersResult getGroupReportUsers(TimeUnit timeUnit, String start, int
APIRequestException {
return _reportClient.getGroupUsers(timeUnit, start, duration);
}
-
+
// ------------------------------ Shortcuts - notification
public PushResult sendNotificationAll(String alert) throws APIConnectionException, APIRequestException {
@@ -313,18 +317,18 @@ public PushResult sendNotificationAll(String alert) throws APIConnectionExceptio
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
* @param alert The notification content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @return push result
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendNotificationAll(String alert, SMS sms) throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.alertAll(alert, sms);
return _pushClient.sendPush(payload);
}
- public PushResult sendAndroidNotificationWithAlias(String title, String alert,
- Map extras, String... alias)
+ public PushResult sendAndroidNotificationWithAlias(String title, String alert,
+ Map extras, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
@@ -338,14 +342,14 @@ public PushResult sendAndroidNotificationWithAlias(String title, String alert,
* Send a notification to Android with alias.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The notification title.
- * @param alert The notification content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param title The notification title.
+ * @param alert The notification content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param extras The extra parameter.
- * @param alias The users' alias.
+ * @param alias The users' alias.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendAndroidNotificationWithAlias(String title, String alert, SMS sms,
Map extras, String... alias)
@@ -359,8 +363,8 @@ public PushResult sendAndroidNotificationWithAlias(String title, String alert, S
return _pushClient.sendPush(payload);
}
- public PushResult sendAndroidNotificationWithRegistrationID(String title, String alert,
- Map extras, String... registrationID)
+ public PushResult sendAndroidNotificationWithRegistrationID(String title, String alert,
+ Map extras, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
@@ -374,14 +378,14 @@ public PushResult sendAndroidNotificationWithRegistrationID(String title, String
* Send a notification to Android with RegistrationID.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The notification title.
- * @param alert The notification content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param extras The extra parameter.
+ * @param title The notification title.
+ * @param alert The notification content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param extras The extra parameter.
* @param registrationID The registration id generated by JPush.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendAndroidNotificationWithRegistrationID(String title, String alert, SMS sms,
Map extras, String... registrationID)
@@ -396,7 +400,7 @@ public PushResult sendAndroidNotificationWithRegistrationID(String title, String
}
public PushResult sendIosNotificationWithAlias(String alert,
- Map extras, String... alias)
+ Map extras, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
@@ -409,13 +413,14 @@ public PushResult sendIosNotificationWithAlias(String alert,
/**
* Send a notification to iOS with alias.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
- * @param alert The notification content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ *
+ * @param alert The notification content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param extras The extra parameter.
- * @param alias The users' alias.
+ * @param alias The users' alias.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithAlias(String alert, SMS sms,
Map extras, String... alias)
@@ -433,12 +438,12 @@ public PushResult sendIosNotificationWithAlias(String alert, SMS sms,
* Send an iOS notification with alias.
* If you want to send alert as a Json object, maybe this method is what you needed.
*
- * @param alert The wrapper of APNs alert.
+ * @param alert The wrapper of APNs alert.
* @param extras The extra params.
- * @param alias The alias list.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithAlias(IosAlert alert,
Map extras, String... alias)
@@ -456,13 +461,13 @@ public PushResult sendIosNotificationWithAlias(IosAlert alert,
* If you want to send alert as a Json object, maybe this method is what you needed.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param alert The wrapper of APNs alert.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param alert The wrapper of APNs alert.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param extras The extra params.
- * @param alias The alias list.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithAlias(IosAlert alert, SMS sms,
Map extras, String... alias)
@@ -480,12 +485,12 @@ public PushResult sendIosNotificationWithAlias(IosAlert alert, SMS sms,
* Send an iOS notification with alias.
* If you want to send alert as a Json object, maybe this method is what you needed.
*
- * @param alert The JSON object of APNs alert.
+ * @param alert The JSON object of APNs alert.
* @param extras The extra params.
- * @param alias The alias list.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithAlias(JsonObject alert,
Map extras, String... alias)
@@ -503,13 +508,13 @@ public PushResult sendIosNotificationWithAlias(JsonObject alert,
* If you want to send alert as a Json object, maybe this method is what you needed.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param alert The JSON object of APNs alert.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param alert The JSON object of APNs alert.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param extras The extra params.
- * @param alias The alias list.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithAlias(JsonObject alert, SMS sms,
Map extras, String... alias)
@@ -523,8 +528,8 @@ public PushResult sendIosNotificationWithAlias(JsonObject alert, SMS sms,
return _pushClient.sendPush(payload);
}
- public PushResult sendIosNotificationWithRegistrationID(String alert,
- Map extras, String... registrationID)
+ public PushResult sendIosNotificationWithRegistrationID(String alert,
+ Map extras, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
@@ -538,13 +543,13 @@ public PushResult sendIosNotificationWithRegistrationID(String alert,
* Send an iOS notification with registrationIds.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param alert The notification content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param extras The extra params.
+ * @param alert The notification content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param extras The extra params.
* @param registrationID The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithRegistrationID(String alert, SMS sms,
Map extras, String... registrationID)
@@ -562,12 +567,12 @@ public PushResult sendIosNotificationWithRegistrationID(String alert, SMS sms,
* Send an iOS notification with registrationIds.
* If you want to send alert as a Json object, maybe this method is what you needed.
*
- * @param alert The wrapper of APNs alert.
- * @param extras The extra params.
+ * @param alert The wrapper of APNs alert.
+ * @param extras The extra params.
* @param registrationID The registration ids.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithRegistrationID(IosAlert alert,
Map extras, String... registrationID)
@@ -585,13 +590,13 @@ public PushResult sendIosNotificationWithRegistrationID(IosAlert alert,
* If you want to send alert as a Json object, maybe this method is what you needed.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param alert The wrapper of APNs alert.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param extras The extra params.
+ * @param alert The wrapper of APNs alert.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param extras The extra params.
* @param registrationID The registration ids.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithRegistrationID(IosAlert alert, SMS sms,
Map extras, String... registrationID)
@@ -609,12 +614,12 @@ public PushResult sendIosNotificationWithRegistrationID(IosAlert alert, SMS sms,
* Send an iOS notification with registrationIds.
* If you want to send alert as a Json object, maybe this method is what you needed.
*
- * @param alert The wrapper of APNs alert.
- * @param extras The extra params.
+ * @param alert The wrapper of APNs alert.
+ * @param extras The extra params.
* @param registrationID The registration ids.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithRegistrationID(JsonObject alert,
Map extras, String... registrationID)
@@ -632,13 +637,13 @@ public PushResult sendIosNotificationWithRegistrationID(JsonObject alert,
* If you want to send alert as a Json object, maybe this method is what you needed.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param alert The JSON object of APNs alert.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param extras The extra params.
+ * @param alert The JSON object of APNs alert.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param extras The extra params.
* @param registrationID The registration ids.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosNotificationWithRegistrationID(JsonObject alert, SMS sms,
Map extras, String... registrationID)
@@ -652,7 +657,7 @@ public PushResult sendIosNotificationWithRegistrationID(JsonObject alert, SMS sm
return _pushClient.sendPush(payload);
}
-
+
// ---------------------- shortcuts - message
public PushResult sendMessageAll(String msgContent) throws APIConnectionException, APIRequestException {
@@ -665,17 +670,17 @@ public PushResult sendMessageAll(String msgContent) throws APIConnectionExceptio
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
* @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendMessageAll(String msgContent, SMS sms) throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.messageAll(msgContent, sms);
return _pushClient.sendPush(payload);
}
- public PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias)
+ public PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
@@ -692,13 +697,13 @@ public PushResult sendAndroidMessageWithAlias(String title, String msgContent, S
* Send an Android message with alias.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The message title.
+ * @param title The message title.
* @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param alias The alias list.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendAndroidMessageWithAlias(String title, String msgContent, SMS sms, String... alias)
throws APIConnectionException, APIRequestException {
@@ -714,7 +719,7 @@ public PushResult sendAndroidMessageWithAlias(String title, String msgContent, S
return _pushClient.sendPush(payload);
}
- public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID)
+ public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
@@ -731,13 +736,13 @@ public PushResult sendAndroidMessageWithRegistrationID(String title, String msgC
* Send an Android message with registration id.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The message title.
- * @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param title The message title.
+ * @param msgContent The message content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param registrationID The registration id list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, SMS sms, String... registrationID)
throws APIConnectionException, APIRequestException {
@@ -753,7 +758,7 @@ public PushResult sendAndroidMessageWithRegistrationID(String title, String msgC
return _pushClient.sendPush(payload);
}
- public PushResult sendIosMessageWithAlias(String title, String msgContent, String... alias)
+ public PushResult sendIosMessageWithAlias(String title, String msgContent, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
@@ -770,13 +775,13 @@ public PushResult sendIosMessageWithAlias(String title, String msgContent, Strin
* Send an iOS message with alias.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The message title.
+ * @param title The message title.
* @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
- * @param alias The alias list.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param alias The alias list.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosMessageWithAlias(String title, String msgContent, SMS sms, String... alias)
throws APIConnectionException, APIRequestException {
@@ -792,7 +797,7 @@ public PushResult sendIosMessageWithAlias(String title, String msgContent, SMS s
return _pushClient.sendPush(payload);
}
- public PushResult sendIosMessageWithRegistrationID(String title, String msgContent, String... registrationID)
+ public PushResult sendIosMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
@@ -809,13 +814,13 @@ public PushResult sendIosMessageWithRegistrationID(String title, String msgConte
* Send an iOS message with registration id.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The message title.
- * @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param title The message title.
+ * @param msgContent The message content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param registrationID The registrationIds generated by JPush.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendIosMessageWithRegistrationID(String title, String msgContent, SMS sms, String... registrationID)
throws APIConnectionException, APIRequestException {
@@ -831,7 +836,7 @@ public PushResult sendIosMessageWithRegistrationID(String title, String msgConte
return _pushClient.sendPush(payload);
}
- public PushResult sendMessageWithRegistrationID(String title, String msgContent, String... registrationID)
+ public PushResult sendMessageWithRegistrationID(String title, String msgContent, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.all())
@@ -848,13 +853,13 @@ public PushResult sendMessageWithRegistrationID(String title, String msgContent,
* Send a message with registrationIds.
* If it doesn't received within the delay time,JPush will send a SMS to the corresponding users.
*
- * @param title The message title.
- * @param msgContent The message content.
- * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
+ * @param title The message title.
+ * @param msgContent The message content.
+ * @param sms The SMS content and delay time. If null, sms doesn't work, no effect on Push feature.
* @param registrationID The registrationIds generated by JPush.
* @return push result.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public PushResult sendMessageWithRegistrationID(String title, String msgContent, SMS sms, String... registrationID)
throws APIConnectionException, APIRequestException {
@@ -872,7 +877,8 @@ public PushResult sendMessageWithRegistrationID(String title, String msgContent,
/**
* Delete a push by msgId.
- * @param msgId The message id
+ *
+ * @param msgId The message id
* @return delete result
* @throws APIConnectionException if a remote or network exception occurs.
* @throws APIRequestException if a request exception occurs
@@ -881,85 +887,85 @@ public DefaultResult deletePush(String msgId) throws APIConnectionException, API
return _pushClient.deletePush(msgId);
}
-
+
// ----------------------- Device
-
- public TagAliasResult getDeviceTagAlias(String registrationId)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.getDeviceTagAlias(registrationId);
+
+ public TagAliasResult getDeviceTagAlias(String registrationId)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.getDeviceTagAlias(registrationId);
}
public DefaultResult updateDeviceTagAlias(String registrationId, boolean clearAlias, boolean clearTag)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.updateDeviceTagAlias(registrationId, clearAlias, clearTag);
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.updateDeviceTagAlias(registrationId, clearAlias, clearTag);
+ }
+
+ public DefaultResult updateDeviceTagAlias(String registrationId, String alias,
+ Set tagsToAdd, Set tagsToRemove)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.updateDeviceTagAlias(registrationId, alias, tagsToAdd, tagsToRemove);
+ }
+
+ public TagListResult getTagList()
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.getTagList();
+ }
+
+ public BooleanResult isDeviceInTag(String theTag, String registrationID)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.isDeviceInTag(theTag, registrationID);
+ }
+
+ public DefaultResult addRemoveDevicesFromTag(String theTag,
+ Set toAddUsers, Set toRemoveUsers)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.addRemoveDevicesFromTag(theTag, toAddUsers,
+ toRemoveUsers);
+ }
+
+ public DefaultResult deleteTag(String theTag, String platform)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.deleteTag(theTag, platform);
+ }
+
+ public AliasDeviceListResult getAliasDeviceList(String alias,
+ String platform) throws APIConnectionException, APIRequestException {
+ return _deviceClient.getAliasDeviceList(alias, platform);
+ }
+
+ public DefaultResult deleteAlias(String alias, String platform)
+ throws APIConnectionException, APIRequestException {
+ return _deviceClient.deleteAlias(alias, platform);
}
-
- public DefaultResult updateDeviceTagAlias(String registrationId, String alias,
- Set tagsToAdd, Set tagsToRemove)
+
+ public DefaultResult removeDevicesFromAlias(String alias, Set toRemoveDevice)
throws APIConnectionException, APIRequestException {
- return _deviceClient.updateDeviceTagAlias(registrationId, alias, tagsToAdd, tagsToRemove);
- }
-
- public TagListResult getTagList()
- throws APIConnectionException, APIRequestException {
- return _deviceClient.getTagList();
- }
-
- public BooleanResult isDeviceInTag(String theTag, String registrationID)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.isDeviceInTag(theTag, registrationID);
- }
-
- public DefaultResult addRemoveDevicesFromTag(String theTag,
- Set toAddUsers, Set toRemoveUsers)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.addRemoveDevicesFromTag(theTag, toAddUsers,
- toRemoveUsers);
- }
-
- public DefaultResult deleteTag(String theTag, String platform)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.deleteTag(theTag, platform);
- }
-
- public AliasDeviceListResult getAliasDeviceList(String alias,
- String platform) throws APIConnectionException, APIRequestException {
- return _deviceClient.getAliasDeviceList(alias, platform);
- }
-
- public DefaultResult deleteAlias(String alias, String platform)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.deleteAlias(alias, platform);
- }
-
- public DefaultResult removeDevicesFromAlias(String alias, Set toRemoveDevice)
- throws APIConnectionException, APIRequestException {
- return _deviceClient.removeDevicesFromAlias(alias, toRemoveDevice);
- }
+ return _deviceClient.removeDevicesFromAlias(alias, toRemoveDevice);
+ }
public Map getUserOnlineStatus(String... registrationIds)
- throws APIConnectionException, APIRequestException
- {
+ throws APIConnectionException, APIRequestException {
return _deviceClient.getUserOnlineStatus(registrationIds);
}
public DefaultResult bindMobile(String registrationId, String mobile)
- throws APIConnectionException, APIRequestException
- {
+ throws APIConnectionException, APIRequestException {
return _deviceClient.bindMobile(registrationId, mobile);
}
// ----------------------- Schedule
+
/**
* Create a single schedule.
- * @param name The schedule name.
- * @param time The push time, format is 'yyyy-MM-dd HH:mm:ss'
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param time The push time, format is 'yyyy-MM-dd HH:mm:ss'
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createSingleSchedule(String name, String time, PushPayload push, String masterSecret,
String appKey)
@@ -979,16 +985,17 @@ public ScheduleResult createSingleSchedule(String name, String time, PushPayload
/**
* Create a daily schedule push everyday.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createDailySchedule(String name, String start, String end, String time, PushPayload push,
String masterSecret, String appKey)
@@ -999,17 +1006,18 @@ public ScheduleResult createDailySchedule(String name, String start, String end,
/**
* Create a daily schedule push with a custom frequency.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'
- * @param frequency The custom frequency.
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'
+ * @param frequency The custom frequency.
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createDailySchedule(String name, String start, String end, String time, int frequency,
PushPayload push, String masterSecret, String appKey)
@@ -1020,17 +1028,18 @@ public ScheduleResult createDailySchedule(String name, String start, String end,
/**
* Create a weekly schedule push every week at the appointed days.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'
- * @param days The appointed days.
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'
+ * @param days The appointed days.
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createWeeklySchedule(String name, String start, String end, String time, Week[] days,
PushPayload push, String masterSecret, String appKey)
@@ -1038,7 +1047,7 @@ public ScheduleResult createWeeklySchedule(String name, String start, String end
Preconditions.checkArgument(null != days && days.length > 0, "The days must not be empty.");
String[] points = new String[days.length];
- for(int i = 0 ; i < days.length; i++) {
+ for (int i = 0; i < days.length; i++) {
points[i] = days[i].name();
}
return createPeriodicalSchedule(name, start, end, time, TimeUnit.WEEK, 1, points, push,
@@ -1047,18 +1056,19 @@ public ScheduleResult createWeeklySchedule(String name, String start, String end
/**
* Create a weekly schedule push with a custom frequency at the appointed days.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'.
- * @param frequency The custom frequency.
- * @param days The appointed days.
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'.
+ * @param frequency The custom frequency.
+ * @param days The appointed days.
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createWeeklySchedule(String name, String start, String end, String time, int frequency,
Week[] days, PushPayload push, String masterSecret, String appKey)
@@ -1066,7 +1076,7 @@ public ScheduleResult createWeeklySchedule(String name, String start, String end
Preconditions.checkArgument(null != days && days.length > 0, "The days must not be empty.");
String[] points = new String[days.length];
- for(int i = 0 ; i < days.length; i++) {
+ for (int i = 0; i < days.length; i++) {
points[i] = days[i].name();
}
return createPeriodicalSchedule(name, start, end, time, TimeUnit.WEEK, frequency, points, push, masterSecret, appKey);
@@ -1074,17 +1084,18 @@ public ScheduleResult createWeeklySchedule(String name, String start, String end
/**
* Create a monthly schedule push every month at the appointed days.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'.
- * @param points The appointed days.
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'.
+ * @param points The appointed days.
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createMonthlySchedule(String name, String start, String end, String time, String[] points,
PushPayload push, String masterSecret, String appKey)
@@ -1095,18 +1106,19 @@ public ScheduleResult createMonthlySchedule(String name, String start, String en
/**
* Create a monthly schedule push with a custom frequency at the appointed days.
- * @param name The schedule name.
- * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
- * @param time The push time, format 'HH:mm:ss'.
- * @param frequency The custom frequency.
- * @param points The appointed days.
- * @param push The push payload.
+ *
+ * @param name The schedule name.
+ * @param start The schedule comes into effect date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param end The schedule expiration date, format 'yyyy-MM-dd HH:mm:ss'.
+ * @param time The push time, format 'HH:mm:ss'.
+ * @param frequency The custom frequency.
+ * @param points The appointed days.
+ * @param push The push payload.
* @param masterSecret master secret
- * @param appKey app key
+ * @param appKey app key
* @return The created scheduleResult instance.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult createMonthlySchedule(String name, String start, String end, String time, int frequency, String[] points,
PushPayload push, String masterSecret, String appKey)
@@ -1117,33 +1129,36 @@ public ScheduleResult createMonthlySchedule(String name, String start, String en
/**
* Get the schedule information by the schedule id.
+ *
* @param scheduleId The schedule id.
* @return The schedule information.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult getSchedule(String scheduleId)
throws APIConnectionException, APIRequestException {
- return _scheduleClient.getSchedule(scheduleId);
+ return _scheduleClient.getSchedule(scheduleId);
}
-
+
/**
* Get the message id by the schedule id.
+ *
* @param scheduleId The schedule id.
* @return The message id list.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleMsgIdsResult getScheduleMsgIds(String scheduleId)
throws APIConnectionException, APIRequestException {
- return _scheduleClient.getScheduleMsgIds(scheduleId);
+ return _scheduleClient.getScheduleMsgIds(scheduleId);
}
/**
* Get the schedule list size and the first page.
+ *
* @return The schedule list size and the first page.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleListResult getScheduleList()
throws APIConnectionException, APIRequestException {
@@ -1152,10 +1167,11 @@ public ScheduleListResult getScheduleList()
/**
* Get the schedule list by the page.
+ *
* @param page The page to search.
* @return The schedule list of the appointed page.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleListResult getScheduleList(int page)
throws APIConnectionException, APIRequestException {
@@ -1164,11 +1180,12 @@ public ScheduleListResult getScheduleList(int page)
/**
* Update the schedule name
+ *
* @param scheduleId The schedule id.
- * @param name The new name.
+ * @param name The new name.
* @return The schedule information after updated.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult updateScheduleName(String scheduleId, String name)
throws APIConnectionException, APIRequestException {
@@ -1181,10 +1198,11 @@ public ScheduleResult updateScheduleName(String scheduleId, String name)
/**
* Enable the schedule.
+ *
* @param scheduleId The schedule id.
* @return The schedule information after updated.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult enableSchedule(String scheduleId)
throws APIConnectionException, APIRequestException {
@@ -1197,10 +1215,11 @@ public ScheduleResult enableSchedule(String scheduleId)
/**
* Disable the schedule.
+ *
* @param scheduleId The schedule id.
* @return The schedule information after updated.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult disableSchedule(String scheduleId)
throws APIConnectionException, APIRequestException {
@@ -1212,11 +1231,12 @@ public ScheduleResult disableSchedule(String scheduleId)
/**
* Update the trigger of the schedule.
+ *
* @param scheduleId The schedule id.
- * @param trigger The new trigger.
+ * @param trigger The new trigger.
* @return The schedule information after updated.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult updateScheduleTrigger(String scheduleId, TriggerPayload trigger)
throws APIConnectionException, APIRequestException {
@@ -1229,11 +1249,12 @@ public ScheduleResult updateScheduleTrigger(String scheduleId, TriggerPayload tr
/**
* Update the push content of the schedule.
+ *
* @param scheduleId The schedule id.
- * @param push The new push payload.
+ * @param push The new push payload.
* @return The schedule information after updated.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult updateSchedulePush(String scheduleId, PushPayload push)
throws APIConnectionException, APIRequestException {
@@ -1246,11 +1267,12 @@ public ScheduleResult updateSchedulePush(String scheduleId, PushPayload push)
/**
* Update a schedule by the id.
+ *
* @param scheduleId The schedule id to update.
- * @param payload The new schedule payload.
+ * @param payload The new schedule payload.
* @return The new schedule information.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public ScheduleResult updateSchedule(String scheduleId, SchedulePayload payload)
throws APIConnectionException, APIRequestException {
@@ -1259,9 +1281,10 @@ public ScheduleResult updateSchedule(String scheduleId, SchedulePayload payload)
/**
* Delete a schedule by id.
+ *
* @param scheduleId The schedule id.
* @throws APIConnectionException if a remote or network exception occurs.
- * @throws APIRequestException if a request exception occurs.
+ * @throws APIRequestException if a request exception occurs.
*/
public void deleteSchedule(String scheduleId)
throws APIConnectionException, APIRequestException {
@@ -1274,7 +1297,7 @@ private ScheduleResult createPeriodicalSchedule(String name, String start, Strin
throws APIConnectionException, APIRequestException {
TriggerPayload trigger = TriggerPayload.newBuilder()
.setPeriodTime(start, end, time)
- .setTimeFrequency(timeUnit, frequency, point )
+ .setTimeFrequency(timeUnit, frequency, point)
.buildPeriodical();
SchedulePayload payload = SchedulePayload.newBuilder()
.setName(name)
@@ -1286,6 +1309,10 @@ private ScheduleResult createPeriodicalSchedule(String name, String start, Strin
return _scheduleClient.createSchedule(payload, masterSecret, appKey);
}
+ public PushResult sendLiveActivity(LiveActivity liveActivity) throws APIConnectionException, APIRequestException {
+ return _pushClient.sendLiveActivity(liveActivity);
+ }
+
public void close() {
_pushClient.close();
}
diff --git a/src/main/java/cn/jpush/api/admin/AdminClient.java b/src/main/java/cn/jpush/api/admin/AdminClient.java
index 040b791b..57bce1c2 100644
--- a/src/main/java/cn/jpush/api/admin/AdminClient.java
+++ b/src/main/java/cn/jpush/api/admin/AdminClient.java
@@ -115,8 +115,8 @@ public void uploadCertificate(String appKey, String devCertificateFile, String d
NativeHttpClient client = (NativeHttpClient) mHttpClient;
String url = mBasePath + mV1AppPath + "/" + appKey + "/certificate";
- Map fileMap = new HashMap<>();
- Map textMap = new HashMap<>();
+ Map fileMap = new HashMap();
+ Map textMap = new HashMap();
if(devCertificateFile != null) {
textMap.put("devCertificatePassword", devCertificatePassword);
diff --git a/src/main/java/cn/jpush/api/file/FileClient.java b/src/main/java/cn/jpush/api/file/FileClient.java
index ac38257d..da1ac10f 100644
--- a/src/main/java/cn/jpush/api/file/FileClient.java
+++ b/src/main/java/cn/jpush/api/file/FileClient.java
@@ -46,22 +46,29 @@ public FileClient(String masterSecret, String appKey, HttpProxy proxy, ClientCon
this._httpClient = new NativeHttpClient(authCode, proxy, conf);
}
- public FileUploadResult uploadFile(FileType type, String filename)
+ public FileUploadResult uploadFile(FileType type, String filename, Integer ttl)
throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(type != null, "type should not be null");
Preconditions.checkArgument(StringUtils.isNotEmpty(filename), "filename should not be null");
+ Preconditions.checkArgument(ttl >= 1 && ttl <= 720,"TTL is not in the range of 1 to 720");
NativeHttpClient client = (NativeHttpClient) _httpClient;
String typeStr = type.value();
String url = _baseUrl + _filesPath + "/" + typeStr;
- Map fileMap = new HashMap<>();
+ Map fileMap = new HashMap();
fileMap.put("filename", filename);
- String response = client.formUploadByPost(url, null, fileMap, null);
+ Map textMap = new HashMap();
+ textMap.put("ttl",String.valueOf(ttl));
+ String response = client.formUploadByPost(url, textMap, fileMap, null);
LOG.info("uploadFile:{}", response);
return _gson.fromJson(response,
new TypeToken() {
}.getType());
}
+ public FileUploadResult uploadFile(FileType type, String filename) throws APIConnectionException, APIRequestException {
+ return uploadFile(type,filename,720);
+ }
+
public FileModelPage queryEffectFiles() throws APIConnectionException, APIRequestException {
String url = _baseUrl + _filesPath + "/";
ResponseWrapper response = _httpClient.sendGet(url);
diff --git a/src/main/java/cn/jpush/api/image/ImageClient.java b/src/main/java/cn/jpush/api/image/ImageClient.java
index 0ec491f2..101f78c7 100644
--- a/src/main/java/cn/jpush/api/image/ImageClient.java
+++ b/src/main/java/cn/jpush/api/image/ImageClient.java
@@ -79,17 +79,14 @@ public ImageUploadResult uploadImage(ImageUrlPayload imageUrlPayload)
* Upload image by file. Require at least 1 non-null fileName. Currently only support Xiaomi and OPPO
* @param imageFilePayload image file payload
* @return {@link ImageUploadResult}
- * @throws APIConnectionException connect exception
- * @throws APIRequestException request exception
*/
- public ImageUploadResult uploadImage(ImageFilePayload imageFilePayload)
- throws APIConnectionException, APIRequestException{
+ public ImageUploadResult uploadImage(ImageFilePayload imageFilePayload) {
Preconditions.checkArgument(imageFilePayload.getImageType() != null, "Image type should not be null");
checkImageFilePayload(imageFilePayload);
NativeHttpClient client = (NativeHttpClient) _httpClient;
String url = _baseUrl + _imagesPath + "/" + ImageSource.FILE.value();
- Map textMap = new HashMap<>();
+ Map textMap = new HashMap();
textMap.put("image_type", String.valueOf(imageFilePayload.getImageType().value()));
Map fileMap = imageFilePayload.toFileMap();
@@ -139,11 +136,8 @@ public ImageUploadResult modifyImage(String mediaId, ImageUrlPayload imageUrlPay
* @param mediaId media id
* @param imageFilePayload image file payload
* @return {@link ImageUploadResult}
- * @throws APIConnectionException connection exception
- * @throws APIRequestException request exception
*/
- public ImageUploadResult modifyImage(String mediaId, ImageFilePayload imageFilePayload)
- throws APIConnectionException, APIRequestException {
+ public ImageUploadResult modifyImage(String mediaId, ImageFilePayload imageFilePayload) {
Preconditions.checkArgument(StringUtils.isNotEmpty(mediaId), "mediaId should not be empty");
checkImageFilePayload(imageFilePayload);
NativeHttpClient client = (NativeHttpClient) _httpClient;
@@ -181,4 +175,4 @@ private void checkImageFilePayload(ImageFilePayload imageFilePayload) {
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/cn/jpush/api/image/model/ImageFilePayload.java b/src/main/java/cn/jpush/api/image/model/ImageFilePayload.java
index 7a4be086..f8143484 100644
--- a/src/main/java/cn/jpush/api/image/model/ImageFilePayload.java
+++ b/src/main/java/cn/jpush/api/image/model/ImageFilePayload.java
@@ -22,7 +22,7 @@ public class ImageFilePayload {
private String jiguangFileName;
public Map toFileMap() {
- HashMap fileMap = new HashMap<>();
+ HashMap fileMap = new HashMap();
if (null != oppoFileName) {
fileMap.put(OPPO_IMAGE_FILE, oppoFileName);
}
diff --git a/src/main/java/cn/jpush/api/push/PushClient.java b/src/main/java/cn/jpush/api/push/PushClient.java
index e0262406..493d0818 100644
--- a/src/main/java/cn/jpush/api/push/PushClient.java
+++ b/src/main/java/cn/jpush/api/push/PushClient.java
@@ -10,6 +10,7 @@
import cn.jiguang.common.utils.sm2.SM2Util;
import cn.jpush.api.push.model.*;
import cn.jpush.api.push.model.audience.Audience;
+import cn.jpush.api.push.model.live_activity.LiveActivity;
import com.google.gson.*;
import java.util.List;
@@ -45,7 +46,8 @@ public class PushClient {
// encrypt type, the default value is empty
private String _encryptType;
- public PushClient() {}
+ public PushClient() {
+ }
/**
* Create a Push Client.
@@ -57,6 +59,10 @@ public PushClient(String masterSecret, String appKey) {
this(masterSecret, appKey, null, ClientConfig.getInstance());
}
+ public PushClient(String masterSecret, String appKey, ClientConfig clientConfig) {
+ this(masterSecret, appKey, null, clientConfig);
+ }
+
/**
* This will be removed in the future. Please use ClientConfig{jiguang-common cn.jiguang.common.ClientConfig} instead of this constructor.
*
@@ -375,6 +381,12 @@ private void checkPushPayload(PushPayload pushPayload) {
}
}
+
+ public PushResult sendLiveActivity(LiveActivity liveActivity) throws APIConnectionException, APIRequestException {
+ ResponseWrapper response = _httpClient.sendPost(_baseUrl + _pushPath, liveActivity.toJSON().toString());
+ return BaseResult.fromResponse(response, PushResult.class);
+ }
+
}
diff --git a/src/main/java/cn/jpush/api/push/model/Message.java b/src/main/java/cn/jpush/api/push/model/Message.java
index e57c5641..b87f5b6a 100644
--- a/src/main/java/cn/jpush/api/push/model/Message.java
+++ b/src/main/java/cn/jpush/api/push/model/Message.java
@@ -22,18 +22,20 @@ public class Message implements PushModel {
private static final String MSG_CONTENT = "msg_content";
private static final String TITLE = "title";
private static final String CONTENT_TYPE = "content_type";
+ private static final String TEST_MESSAGE = "test_message";
private static final String EXTRAS = "extras";
private final String msgContent;
private final String title;
private final String contentType;
+ private final Boolean testMessage;
private final Map extras;
private final Map numberExtras;
private final Map booleanExtras;
private final Map jsonExtras;
private final Map customData;
- private Message(String title, String msgContent, String contentType,
+ private Message(String title, String msgContent, String contentType, Boolean testMessage,
Map extras,
Map numberExtras,
Map booleanExtras,
@@ -42,6 +44,7 @@ private Message(String title, String msgContent, String contentType,
this.title = title;
this.msgContent = msgContent;
this.contentType = contentType;
+ this.testMessage = testMessage;
this.extras = extras;
this.numberExtras = numberExtras;
this.booleanExtras = booleanExtras;
@@ -69,6 +72,9 @@ public JsonElement toJSON() {
if (null != contentType) {
json.add(CONTENT_TYPE, new JsonPrimitive(contentType));
}
+ if (null != testMessage) {
+ json.add(TEST_MESSAGE, new JsonPrimitive(testMessage));
+ }
JsonObject extrasObject = null;
if (null != extras || null != numberExtras || null != booleanExtras || null != jsonExtras) {
@@ -118,6 +124,7 @@ public static class Builder {
private String title;
private String msgContent;
private String contentType;
+ private Boolean testMessage;
private Map extrasBuilder;
private Map numberExtrasBuilder;
private Map booleanExtrasBuilder;
@@ -139,6 +146,11 @@ public Builder setContentType(String contentType) {
return this;
}
+ public Builder setTestMessage(Boolean testMessage) {
+ this.testMessage = testMessage;
+ return this;
+ }
+
public Builder addExtra(String key, String value) {
Preconditions.checkArgument(!(null == key || null == value), "Key/Value should not be null.");
if (null == extrasBuilder) {
@@ -188,7 +200,7 @@ public Builder addExtra(String key, JsonObject value) {
public Builder addCustom(Map extras) {
if (customData == null) {
- customData = new LinkedHashMap<>();
+ customData = new LinkedHashMap();
}
for (Map.Entry entry : extras.entrySet()) {
customData.put(entry.getKey(), new JsonPrimitive(entry.getValue()));
@@ -199,7 +211,7 @@ public Builder addCustom(Map extras) {
public Builder addCustom(String key, Number value) {
Preconditions.checkArgument(!(null == key), "Key should not be null.");
if (customData == null) {
- customData = new LinkedHashMap<>();
+ customData = new LinkedHashMap();
}
customData.put(key, new JsonPrimitive(value));
return this;
@@ -208,7 +220,7 @@ public Builder addCustom(String key, Number value) {
public Builder addCustom(String key, String value) {
Preconditions.checkArgument(!(null == key), "Key should not be null.");
if (customData == null) {
- customData = new LinkedHashMap<>();
+ customData = new LinkedHashMap();
}
customData.put(key, new JsonPrimitive(value));
return this;
@@ -217,7 +229,7 @@ public Builder addCustom(String key, String value) {
public Builder addCustom(String key, Boolean value) {
Preconditions.checkArgument(!(null == key), "Key should not be null.");
if (customData == null) {
- customData = new LinkedHashMap<>();
+ customData = new LinkedHashMap();
}
customData.put(key, new JsonPrimitive(value));
return this;
@@ -226,7 +238,7 @@ public Builder addCustom(String key, Boolean value) {
public Message build() {
Preconditions.checkArgument(!(null == msgContent),
"msgContent should be set");
- return new Message(title, msgContent, contentType,
+ return new Message(title, msgContent, contentType, testMessage,
extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder, jsonExtrasBuilder, customData);
}
}
diff --git a/src/main/java/cn/jpush/api/push/model/Notification3rd.java b/src/main/java/cn/jpush/api/push/model/Notification3rd.java
index 7d0bd71b..ef78e8ad 100644
--- a/src/main/java/cn/jpush/api/push/model/Notification3rd.java
+++ b/src/main/java/cn/jpush/api/push/model/Notification3rd.java
@@ -14,7 +14,7 @@
* 使用说明
* notification_3rd 只针对开通了厂商通道的用户生效;
* notification 和 notification_3rd 不能同时有内容,如果这两块同时有内容,则会返回错误提示;
- * notification_3rd 的内容对 iOS 和 WinPhone 平台无效,只针对 Android 平台生效;
+ * notification_3rd 的内容对 iOS 和 HMOS 平台无效,只针对 Android 平台生效;
* notification_3rd 是用作补发厂商通知的内容,只有当 message 部分有内容,才允许传递此字段,且要两者都不为空时,才会对离线的厂商设备转发厂商通道的通知。
*/
public class Notification3rd implements PushModel{
@@ -24,6 +24,7 @@ public class Notification3rd implements PushModel{
private static final String URI_ACTIVITY = "uri_activity";
private static final String URI_ACTION = "uri_action";
private static final String BADGE_ADD_NUM = "badge_add_num";
+ private static final String BADGE_SET_NUM = "badge_set_num";
private static final String BADGE_CLASS = "badge_class";
private static final String SOUND = "sound";
private static final String EXTRAS = "extras";
@@ -35,6 +36,7 @@ public class Notification3rd implements PushModel{
private final String uri_activity;
private final String uri_action;
private final int badge_add_num;
+ private final int badge_set_num;
private final String badge_class;
private final String sound;
private final Map extras;
@@ -43,7 +45,7 @@ public class Notification3rd implements PushModel{
private final Map jsonExtras;
private Notification3rd(String title, String content, String channel_id,
- String uri_activity, String uri_action, int badge_add_num,
+ String uri_activity, String uri_action, int badge_add_num,int badge_set_num,
String badge_class, String sound,
Map extras,
Map numberExtras,
@@ -55,6 +57,7 @@ private Notification3rd(String title, String content, String channel_id,
this.uri_activity = uri_activity;
this.uri_action = uri_action;
this.badge_add_num = badge_add_num;
+ this.badge_set_num = badge_set_num;
this.badge_class = badge_class;
this.sound = sound;
this.extras = extras;
@@ -97,6 +100,10 @@ public JsonElement toJSON() {
json.addProperty(BADGE_ADD_NUM, badge_add_num);
}
+ if (0 != badge_set_num) {
+ json.addProperty(BADGE_SET_NUM, badge_set_num);
+ }
+
if (null != badge_class) {
json.addProperty(BADGE_CLASS, badge_class);
}
@@ -164,6 +171,7 @@ public static class Builder{
private String uri_activity;
private String uri_action;
private int badge_add_num;
+ private int badge_set_num;
private String badge_class;
private String sound;
protected Map extrasBuilder;
@@ -201,6 +209,11 @@ public Builder setBadgeAddNum(int badge_add_num) {
return this;
}
+ public Builder setBadgeSetNum(int badge_set_num) {
+ this.badge_set_num = badge_set_num;
+ return this;
+ }
+
public Builder setBadgeClass(String badge_class) {
this.badge_class = badge_class;
return this;
@@ -263,7 +276,7 @@ public Builder addExtra(String key, JsonObject value) {
public Notification3rd build() {
Preconditions.checkArgument(content != null && content != "", "content should not be null or empty");
- return new Notification3rd(title, content, channel_id, uri_activity, uri_action, badge_add_num,
+ return new Notification3rd(title, content, channel_id, uri_activity, uri_action, badge_add_num, badge_set_num,
badge_class, sound, extrasBuilder, numberExtrasBuilder, booleanExtrasBuilder, jsonExtrasBuilder);
}
}
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 0e0f07e6..dfcae593 100644
--- a/src/main/java/cn/jpush/api/push/model/Options.java
+++ b/src/main/java/cn/jpush/api/push/model/Options.java
@@ -11,6 +11,22 @@
import java.util.Map;
import java.util.Set;
+/**
+ * 参考文档:https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push#options
+ *
+ *