PushSharp notifications always raise "NotificationSent" or "NotificationFailed" events

I am implementing Apple push notification service and processing the internal queue. I would like to know if PushSharp notifications always raise NotificationSent or NotificationFailed events (one or the other - at least one of them).

Also, if the notification successfully sends, then the NotificationSent event always fires for each successful notification sent, or there may be circumstances when this does not happen, even if it was sent successfully?

+4
source share
1 answer

I worked with PushSharp (latest version of lib v2.0.4), and all my messages were either triggered by NotificationFailed() or NotificationSent() . But this does not guarantee that messages reach the end user (device). Apple or Google send an ACK that their servers received a notification successfully (or not) from my push service. Then it is in their hands to send to the end device.

Also, how do you close your push services? If you call StopAllServices(true) , the service will wait until all ACKS are received before shutting down. If called as StopAllServices(false) , it is disabled without waiting for acks to appear, and therefore the NotificationFailed() or NotificationSent() events will not be fired.

Hope this helps.

+2
source

Source: https://habr.com/ru/post/1485333/


All Articles