예제 #1
0
        public void InitIOSCertTest()
        {
            var request = new AppIOSCertInitRequest
                          (
                "testCert",
                "test cert operate by unit test init",
                "releaseCertContent",
                "DevCertContent"
                          );

            Console.WriteLine("InitAppIOSCert:" + request.Name);

            var client   = new Client(_apiKey, _secretKey);
            var response = client.InitAppIOSCert(request);

            Assert.NotNull(response);
            Assert.Greater(response.RequestId, 0);
        }
예제 #2
0
        /// <summary>
        /// Init App IOS Cert
        /// </summary>
        /// <param name="request">Push request parameter</param>
        /// <returns></returns>
        public AppIOSCertInitResponse InitAppIOSCert(AppIOSCertInitRequest request)
        {
            var postStr = request.GeneratePostData(Apikey, SecretKey);

            var response = PostData(request.ServiceUrl, postStr);

            if (response == null)
            {
                return(null);
            }

            AppIOSCertInitResponse result = null;

            try
            {
                result = JsonConvert.DeserializeObject <AppIOSCertInitResponse>(response);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("InitAppIOSCert Error Response Deserialize Fail, May not valid json:" + ex.Message + " " + response);
            }
            return(result);
        }