Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }