Question

I have a windows service that sends off push notifications for our app. In the service I maintain a list of push notifications for about 60s, so if I don't get any feedback I can attempt a retry.

I know internally PushSharp must use some sort of collection to manage this. Am I duplicating work? Am I guaranteed to get a callback for every notification I send?

Was it helpful?

Solution

Apple don't return a response for a message that was succesfully accepted by the APNS server, and even when a message is accepted by their server, it doesn't guarantee delivery to the device. Therefore whatever feedback you are getting from PushSharp is not something you can rely on. The best PushSharp can do is attempt to read error responses from Apple, and whenever it gets an error response (that contains a message ID), it can assume that all the messages that were sent prior to the failed message were accepted and all the messages after the failed message were rejected and need to be resent.

The only way to know if a message was delivered by APNS to a device is for the device to send an acknowledgment to the server after the user taps the notification. If the user doesn't tap the notification, even this kind of acknowledgment is not possible (except, perhaps, in iOS7 which allows some background processing of the notification before the user taps it).

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