I'm sending notifications with android C2DM. I'm using C2dmSharp. I'm trying to send 200 different notifications to my phone. Server-side I get an OK response with an id=[ID of sent message] (like documented here) so I guess my serve is doing well. But on my phone I only get a few notifications... NOT 200! Ok I know it's not a guaranteed service but it's like 90% of notifications that aren't sent. Am I doing anything wrong? Is it actually possible to send 200 messages in a row to one device?
If you know a better place to ask this, please enlighten me :)
I'm using this to send the notifications
Here's the code :
if (notificationService != null)
{
notificationService.Start();
foreach (var itemToProcess in itemsToProcess)
{
itemToProcess.NotificationDateTime = DateTime.Now;
mobile.SubmitChanges();
string deviceToken = GetCleanDeviceToken(itemToProcess.MobileDevice.PushNotificationIdentifier);
var extras = new NameValueCollection();
extras.Add("salemessage", itemToProcess.MobileDeviceNotificationText.Text);
extras.Add("ismultisale", "false");
if (itemToProcess.SaleId.HasValue) extras.Add("saleid", itemToProcess.SaleId.Value.ToString());
try
{
Thread.Sleep(200);
notificationService.QueueMessage(deviceToken, extras, "key");
}
catch (Exception exception)
{
//logging
}
}
notificationService.Stop();
}
So as C2DM is deprecated, let's use GCM! For .NET servers, there's https://github.com/Redth/PushSharp