Inheritance: cn.jpush.api.common.BaseResult
コード例 #1
0
 public static MessagesResult fromResponse(ResponseWrapper responseWrapper)
 {
     MessagesResult receivedsResult = new MessagesResult();
     if (responseWrapper.responseCode==HttpStatusCode.OK)
     {
         receivedsResult.messages = JsonConvert.DeserializeObject<List<Message>>(responseWrapper.responseContent);
     }
     receivedsResult.ResponseResult = responseWrapper;
     return receivedsResult;
 }
コード例 #2
0
 public static MessagesResult fromResponse(ResponseWrapper responseWrapper)
 {
     MessagesResult receivedsResult = new MessagesResult();
     if (responseWrapper.responseCode==HttpStatusCode.OK)
     {
        receivedsResult.messages = JsonConvert.DeserializeObject<List<Message>>(responseWrapper.responseContent);
        //[{"android":{"received":null,"target":null,"online_push":null,"click":null,"msg_click":null},"ios":{"apns_sent":1,"apns_target":1,"click":null,"target":null,"received":null,"msg_click":null},"winphone":{"mpns_target":null,"mpns_sent":null,"click":null},"msg_id":991969761}]
     }
     receivedsResult.ResponseResult = responseWrapper;
     return receivedsResult;
 }
コード例 #3
0
        private MessagesResult getReportMessages(String msgIds)
        {
            String checkMsgId = checkMsgids(msgIds);
            String url = REPORT_HOST_NAME + REPORT_MESSAGE_PATH_V3 + "?msg_ids=" + checkMsgId;
            String auth = Base64.getBase64Encode(this.appKey + ":" + this.masterSecret);
            ResponseWrapper rsp = this.sendGet(url, auth, null);
            MessagesResult result = new MessagesResult();
            List<MessagesResult.Message> list = new List<MessagesResult.Message>();

            Console.WriteLine("recieve content==" + rsp.responseContent);
            if (rsp.responseCode == System.Net.HttpStatusCode.OK)
            {
                list = (List<MessagesResult.Message>)JsonTool.JsonToObject(rsp.responseContent, list);
                String content = rsp.responseContent;
            }
            result.ResponseResult = rsp;
            result.messages = list;
            return result;
        }