@@ -29,6 +29,11 @@ public JPushClient(String masterSecret, String appKey) {
2929 _reportClient = new ReportClient (masterSecret , appKey );
3030 }
3131
32+ public JPushClient (String masterSecret , String appKey , int maxRetryTimes ) {
33+ _pushClient = new PushClient (masterSecret , appKey , maxRetryTimes );
34+ _reportClient = new ReportClient (masterSecret , appKey , maxRetryTimes );
35+ }
36+
3237 /**
3338 * Create a JPush Client with global settings.
3439 *
@@ -43,27 +48,43 @@ public JPushClient(String masterSecret, String appKey, boolean apnsProduction, l
4348 _pushClient = new PushClient (masterSecret , appKey , apnsProduction , timeToLive );
4449 _reportClient = new ReportClient (masterSecret , appKey );
4550 }
46-
51+
4752 /**
48- * Send a push
53+ * Send a push with object.
4954 *
50- * @param pushPayload payload of a push.
51- * @return PushResult. Can be printed to a JSON.
55+ * @param pushPayload payload object of a push.
56+ * @return PushResult The result object of a Push. Can be printed to a JSON.
57+ * @throws APIConnectionException
58+ * @throws APIRequestException
5259 */
5360 public PushResult sendPush (PushPayload pushPayload ) throws APIConnectionException , APIRequestException {
5461 return _pushClient .sendPush (pushPayload );
5562 }
5663
57- public PushResult sendPush (String payloadString ) throws APIConnectionException , APIRequestException {
58- return _pushClient .sendPush (payloadString );
59- }
60-
6164 /**
62- * Get received report.
65+ * Send a push with JSON string.
66+ *
67+ * You can send a push JSON string directly with this method.
6368 *
64- * @param msgIds 100 msgids to batch getting is supported.
65- * @return ReceivedResult. Can be printed to JSON.
69+ * Attention: globally settings cannot be affect this type of Push.
70+ *
71+ * @param pushPayload payload of a push.
72+ * @return PushResult. Can be printed to a JSON.
73+ * @throws APIConnectionException
74+ * @throws APIRequestException
6675 */
76+ public PushResult sendPush (String payloadString ) throws APIConnectionException , APIRequestException {
77+ return _pushClient .sendPush (payloadString );
78+ }
79+
80+ /**
81+ * Get received report.
82+ *
83+ * @param msgIds 100 msgids to batch getting is supported.
84+ * @return ReceivedResult. Can be printed to JSON.
85+ * @throws APIConnectionException
86+ * @throws APIRequestException
87+ */
6788 public ReceivedsResult getReportReceiveds (String msgIds ) throws APIConnectionException , APIRequestException {
6889 return _reportClient .getReceiveds (msgIds );
6990 }
0 commit comments