public MessageResult sendPush(PushPayload payload) { Preconditions.checkArgument(payload != null, "pushPayload should not be empty"); payload.Check(); String payloadJson = payload.ToJson(); return sendPush(payloadJson); }
public MessageResult sendPush(PushPayload payload) { String payloadString = payload.ToJson(); Preconditions.checkArgument(!string.IsNullOrEmpty(payloadString), "payloadString should not be empty"); String url = HOST_NAME_SSL; url += PUSH_PATH; ResponseWrapper result = sendPost(url, Authorization(), payloadString); MessageResult messResult = new MessageResult(); messResult.ResponseResult = result; JpushSuccess jpushSuccess = JsonConvert.DeserializeObject <JpushSuccess>(result.responseContent); messResult.sendno = long.Parse(jpushSuccess.sendno); messResult.msg_id = long.Parse(jpushSuccess.msg_id); return(messResult); }
public MessageResult sendPush(PushPayload payload) { Preconditions.checkArgument(payload != null, (object)"pushPayload should not be empty"); payload.Check(); return(this.sendPush(payload.ToJson())); }