1.jpushClient.sendPush(pushpayLoad):是发送推送的主要方法
2.pushpayload是具体推送消息、推送对象范围的封装
3.jpushClient.sendPush()的返回值是pushResult,pushResult封装了返回相关的具体信息,包括messageID
4.pushpayload的构造方法为静态方法,
pushpayload = PushPayload.newBuilder() .setAudience(Audience.alias(alias)) .setPlatform(Platform.all()) .setMessage(Message.content(content)).build();
5.获得推送消息的mid:long messigeID = pushResult.msg_id;//静态方法
6.查询推送消息的成功数:
通过receivedResult。receivedResult的获取方法是通过mid获得,jpushClient.getReportReceiveds(mid);
jpushClient = new JPushClient(MASTERSECRET, APPKEY, Integer.valueOf(DAY)); PushPayload payload = null; try { ReceivedsResult result = jpushClient.getReportReceiveds(mid); Received received = result.received_list.get(0); System.out.println("android_received:" + received.android_received + "\nios:" + received.ios_apns_sent); log.debug("Got result - " + result);