4
votes

I've looked into this for a while, but couldn't think of a way how to do this.

In WhatsApp and some other iOS chat apps the following happens.

  • Message receiver force-closes the app (app is not running in the background)
  • Sender sends a message.
  • Receiver receives the APNS push notification.
  • Sender sees the status as Delivered

What's interesting is, it can still do this when the device is turned off.

Let's say the receiver's device is turned off. Then the following happens.

  • Sender sends a message.
  • Sender sees status as Sent (to the server)
  • Receiver turns the phone on (but the app is not running in the background)
  • Receiver gets the push notification on device (but doesn't open it)
  • Sender sees the status as Delivered

GCM has the delivery status, and with APNS we can find the delivery status if the app is running in the background.

Since APNS doesn't have a delivery status feedback service, how does it know when a message has been received by the other end, even when the app is not running in the background?

1
Did you find any mechanism for that?M.Usman

1 Answers

0
votes

APNS/GCM messages are received by special system service, not by application you are used. So when you turn on the phone - that service get messages and send new status to Apple/Google servers, and show notification to user.