Ejemplo n.º 1
0
 public static void main(String[] args) {
   JPushClient client = JPushUtils.getJPush();
   AliasDeviceListResult res;
   try {
     res = client.getAliasDeviceList("6750", "ios");
     System.out.println(res.toString());
   } catch (APIConnectionException e) {
     e.printStackTrace();
   } catch (APIRequestException e) {
     e.printStackTrace();
   }
 }
  public static void testGetMessages() {
    JPushClient jpushClient = new JPushClient(masterSecret, appKey);
    try {
      MessagesResult result = jpushClient.getReportMessages("269978303");
      LOG.debug("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());
    }
  }