internal static void SendNotifications(IEnumerable<string> apiKeys, string application, string header, string message)
{
var data = new NameValueCollection();
data["AuthorizationToken"] = "";
data["Body"] = message;
data["IsImportant"] = IsImportant;
data["IsSilent"] = IsSilent;
data["Source"] = application;
data["TimeToLive"] = TimeToLive;
data["Title"] = header;
if (!Validate(data))
{
return;
}
foreach (var apiKey in apiKeys)
{
using (var client = new WebClient())
{
data.Set("AuthorizationToken", apiKey);
client.Headers[HttpRequestHeader.ContentType] = RequestContentType;
client.UploadValuesAsync(new Uri(RequestUrl), data);
}
}
}