public static void testGetMessageStatus() {
JPushClient jPushClient = new JPushClient(masterSecret, appKey);
CheckMessagePayload payload = CheckMessagePayload.newBuilder()
.setMsgId(3993287034L)
.addRegistrationIds(REGISTRATION_ID1, REGISTRATION_ID2, REGISTRATION_ID3)
.setDate("2017-08-08")
.build();
try {
Map<String, MessageStatus> map = jPushClient.getMessageStatus(payload);
for (Map.Entry<String, MessageStatus> entry : map.entrySet()) {
LOG.info("registrationId: " + entry.getKey() + " status: " + entry.getValue().getStatus());
}
} 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());
}
}