/// <summary> /// fetch_msgcount /// </summary> /// <param name="request">set tag request parameter</param> /// <returns></returns> public MessageCountFetchResponse FetchMessageCount(MessageCountFetchRequest request) { var postStr = request.GeneratePostData(Apikey, SecretKey); var response = PostData(request.ServiceUrl, postStr); if (response == null) return null; MessageCountFetchResponse result = null; try { result = JsonConvert.DeserializeObject<MessageCountFetchResponse>(response); } catch (Exception ex) { Debug.WriteLine("FetchMessageCount Error Response Deserialize Fail, May not valid json:" + ex.Message + " " + response); } return result; }
public void FetchMesssageCountTest() { var request = new MessageCountFetchRequest("945124040446040348"); request.ChannelId = 3789323588078526627; var pushService = new Client(_apiKey, _secretKey); var response = pushService.FetchMessageCount(request); Assert.NotNull(response); Assert.Greater(response.RequestId, 0); }