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

StackOverflow https://stackoverflow.com/questions/17014594

  •  31-05-2022
  •  | 
  •  

Question

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

Also if the notification does successfully send, doe the NotificationSent event always fire for each successful notification sent or can there be circumstances where this does not occur even though it sent successfully?

Was it helpful?

Solution

I've been working with PushSharp (latest lib v2.0.4) and all my messages have either triggered NotificationFailed() or NotificationSent(). But this is no guarantee that the messages will reach the end user (device). Apple or Google are sending an ACK that their servers have received the notification successfully (or not) from my push service. Then it's in their hands to send on to the final device.

Furthermore, how are you closing your push services? If you call StopAllServices(true), the service will wait for all ACKS to be received before shutting down. If called as StopAllServices(false) then it shuts down not waiting for acks and therefore the events NotificationFailed() or NotificationSent() will not be triggered.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top