سؤال

I send push notifications using PushSharp.

I call the method StopAllServices of PushService object to let it send the messages.

I assume that after PushService.StopAllServices finishes , I got the responses for all the Notification objecs.

Afterwards I kill the thread in which the PushService object is instanciated.

PushService = New PushService()
...
...
...

PushService.StopAllServices(True)
...
'the thread dies here

I noticed that sometimes I dont get responses in the callback functions.

Can it be that the method StopAllServices doesnt wait for all responses (from APNS/GCM) ?

I need to recieve responses for all Notification objects. How to achive that ? I'll be glad for sugestions

هل كانت مفيدة؟

المحلول

From the Apple push Service (APNS) you won't get response for all the successfully delivered notifications and that is "by design". Redth (the author of pushSharp) posted a detailed explanation of this : http://redth.info/the-problem-with-apples-push-notification-ser/
So you'll barely never get one response-per-notification-sent anyway, not useful to wait for all answers to stop the service.

And keep in mind that delivering the notification to the provider (android/apple/microsoft) doesn't guarantee you the effective device delivery of the notification anyway...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top