fetch_msgcount 请求参数
Inheritance: ClientRequestBase
示例#1
0
        /// <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;
        }
示例#2
0
        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);
        }