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); }
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); }
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, "")); }
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); }