I send push notifications using PushSharp. I am facing a problem while receiving the responses in the delegate methods as mentioned in Redth documentation on GitHub.
So, of the say 10 GCM Registration Ids that I send a particular message, I receive 9 responses only. I require this kind of response to make sure that in case of canonical Ids returned I should be able to update my database accordingly.
Is this behavior by design (i.e to not wait for all the responses from GCM) which results in few responses getting dropped ?
Below is my code snippets for better understanding
//Create our push services broker
//Create our push services broker
var broker = new PushBroker();
broker.OnNotificationSent += new NotificationSentDelegate(NotificationSent);
broker.OnNotificationFailed += new PushSharp.Core.NotificationFailedDelegate(NotificationFailed);
broker.OnChannelException += new ChannelExceptionDelegate(ChannelException);
broker.OnServiceException += new ServiceExceptionDelegate(ServiceException);
broker.OnDeviceSubscriptionChanged += new DeviceSubscriptionChangedDelegate(DeviceSubscriptionChanged);
broker.OnDeviceSubscriptionExpired += new PushSharp.Core.DeviceSubscriptionExpiredDelegate(DeviceSubscriptionExpired);
broker.OnChannelCreated += new ChannelCreatedDelegate(ChannelCreated);
broker.OnChannelDestroyed += new ChannelDestroyedDelegate(ChannelDestroyed);
//---------------------------
// ANDROID GCM NOTIFICATIONS
//---------------------------
broker.RegisterGcmService(new GcmPushChannelSettings(senderID, senderAuthToken, applicationIdPackageName));
GcmNotification gcm = new GcmNotification();
gcm.RegistrationIds.Add(deviceRegistrationId1);
gcm.RegistrationIds.Add(deviceRegistrationId2);
//and so on
gcm.WithJson("{\"Test\":\"" + notificationMsg + "\",\"badge\":7,\"sound\":\"sound.caf\"}");
//Stop and wait for the queues to drains
broker.StopAllServices(true);
//<
Please advise if I am missing something in this implementation. Thanks in advance