예제 #1
0
파일: PushService.cs 프로젝트: md-prog/LL
        public bool AddPushBatch(string text, string sendDate, int[] ids, string extraData, string link)
        {
            var item = new PushBatchItem
            {
                Badge            = 0,
                BundleId         = this.bundleId,
                Ids              = ids, // "1,15,0"
                ContentAvailable = false,
                ExtraData        = extraData,
                IsSandBox        = false,
                Link             = link,
                SendDate         = sendDate, // "20141225120000"
                Sound            = "",
                Text             = text,
                TimeStamp        = "",
                Passwd           = this.password,
                User             = this.userName
            };

            var sett = new JsonSerializerSettings();

            sett.ContractResolver = new LowercaseContractResolver();

            string json = JsonConvert.SerializeObject(item, Formatting.Indented, sett);

            var res = NetFunc.MakeRequest(json, this.sendTokensUrl, "POST");

            return(res.IsValid);
        }
예제 #2
0
파일: PushService.cs 프로젝트: md-prog/LL
        public bool AddPush(string title, string sendDate, string channels)
        {
            var item = new PushItem
            {
                Badge            = 0,
                BundleId         = this.bundleId,
                Channels         = channels, // "1,15,0"
                ContentAvailable = false,
                ExtraData        = "15255",
                IsSandBox        = false,
                Link             = "",
                SendDate         = sendDate, // "20141225120000"
                Sound            = "",
                Text             = title,
                Passwd           = this.password,
                User             = this.userName
            };

            var sett = new JsonSerializerSettings();

            sett.ContractResolver = new LowercaseContractResolver();

            string json = JsonConvert.SerializeObject(item, Formatting.Indented, sett);

            var res = NetFunc.MakeRequest(json, this.pushUrl, "POST");

            return(res.IsValid);
        }
예제 #3
0
파일: PushService.cs 프로젝트: md-prog/LL
        public string GetTokenId(bool isIOS, string token, string channels, string deviceId, int isSandBox)
        {
            string[] boudelArr = this.bundleId.Split(',');

            string boundel = isIOS ? boudelArr[1] : boudelArr[0];

            string servUrl = string.Format(this.tokenIdUrl + "?token={0}&bundleid={1}&channels={2}&deviceid={3}&issandbox={4}",
                                           token,
                                           boundel,
                                           channels,
                                           deviceId,
                                           isSandBox);

            return(NetFunc.PostData(servUrl, ""));
        }
예제 #4
0
파일: PushService.cs 프로젝트: md-prog/LL
        public bool DelCategories(string channels)
        {
            var item = new PushCatItem
            {
                bundleid = this.bundleId,
                channels = channels,
                passwd   = this.password,
                user     = this.userName
            };

            string json = JsonConvert.SerializeObject(item);

            var res = NetFunc.MakeRequest(json, this.catDelUrl, "DELETE");

            return(res.IsValid);
        }