diff --git a/example/main/java/cn/jpush/api/examples/PushExample.java b/example/main/java/cn/jpush/api/examples/PushExample.java
index f452ccd9..a18dbb09 100644
--- a/example/main/java/cn/jpush/api/examples/PushExample.java
+++ b/example/main/java/cn/jpush/api/examples/PushExample.java
@@ -46,6 +46,8 @@ public class PushExample {
public static void main(String[] args) {
+ // 回调参数可参考下面方法
+ testSendPushWithCustom();
testSendPushWithCustomField();
// testBatchSend();
testSendPushWithCustomConfig();
@@ -630,5 +632,51 @@ public static void testSendPushWithCustomField() {
}
}
+ /**
+ * 回调参数示例
+ */
+ public static void testSendPushWithCustom() {
+
+ ClientConfig config = ClientConfig.getInstance();
+ // Setup the custom hostname
+ config.setPushHostName("https://api.jpush.cn");
+
+ JPushClient jpushClient = new JPushClient(MASTER_SECRET, APP_KEY, null, config);
+
+ Notification notification = Notification.newBuilder()
+ .addPlatformNotification(AndroidNotification.newBuilder()
+ .setAlert(ALERT)
+ .setTitle("Alert test")
+ .build())
+ .build();
+
+ JsonObject callback = new JsonObject();
+ callback.addProperty("url", "https://www.jiguagn.cn/callback");
+ JsonObject params = new JsonObject();
+ params.addProperty("name", "joe");
+ params.addProperty("age", 26);
+ callback.add("params", params);
+ callback.addProperty("type", 3);
+
+ PushPayload.Builder payloadBuilder = new PushPayload.Builder()
+ .setPlatform(Platform.all())
+ .setAudience(Audience.all())
+ .setNotification(notification)
+ .addCustom("callback", callback);
+
+ try {
+ PushResult result = jpushClient.sendPush(payloadBuilder.build());
+ LOG.info("Got result - " + result);
+ } catch (APIConnectionException e) {
+ LOG.error("Connection error. Should retry later. ", e);
+ } catch (APIRequestException e) {
+ LOG.error("Error response from JPush server. Should review and fix it. ", e);
+ LOG.info("HTTP Status: " + e.getStatus());
+ LOG.info("Error Code: " + e.getErrorCode());
+ LOG.info("Error Message: " + e.getErrorMessage());
+ LOG.info("Msg ID: " + e.getMsgId());
+ }
+ }
+
}
diff --git a/pom.xml b/pom.xml
index ff26a476..463c9c25 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
cn.jpush.api
jpush-client
- 3.4.3-SNAPSHOT
+ 3.4.3
jar
https://github.com/jpush/jpush-api-java-client
JPush API Java Client
diff --git a/src/main/java/cn/jpush/api/push/model/BatchPushResult.java b/src/main/java/cn/jpush/api/push/model/BatchPushResult.java
index da762cad..8a4777cd 100644
--- a/src/main/java/cn/jpush/api/push/model/BatchPushResult.java
+++ b/src/main/java/cn/jpush/api/push/model/BatchPushResult.java
@@ -12,11 +12,6 @@
import java.util.List;
import java.util.Map;
-/**
- * @author xudanxia
- * @Desc
- * @date 2019-08-22.
- */
public class BatchPushResult extends BaseResult {
private static final Type RESULT_TYPE = new TypeToken