How does WhatsApp know if the user gets the push notification even if the app is runnng in the background and is not open?

26,299

Solution 1

Let us call the iPhone with WhatsApp application closed - the receiver and the other iPhone you send messages with - the sender, and let us use generic term application instead of WhatsApp

The application at the sender is not able to learn that push notification has reached the receiver. It is by the nature of push notifications.

However, the sender is possible to send another - not a push notification, but prioprietary protocol - message to the application at the receiver which it (the receiver) is welcome to acknowledge to the sender in any application-specific way it wants.

So, I would guess (I don't know - I'm not affiliated with WhatsApp in anyway) that the double-v icon you get is when application message reaches the application at the receiver - and has nothing to do with push notification.

Solution 2

What you mean is just the basics of push-technology :

The whatsapp software runs in the background listening on a specific port for incoming messages. It does this continuously.

BTW :

One V = message delivered from your mobile to the whatsapp server

Two V's = message pushed from whatsapp server to recipient mobile

Blue V's indicate message has been read

Solution 3

Whatsapp doesn't show if the person reads the message or not. It just informs when the message has been sent to the whatsapp servers(one V) and when it has been sent the person phone (2 V's). The double does not mean the message was read it just means that whatsapp connected to the phone and was able to pass on the message.

Solution 4

After receiving a push notification the receiver can download data from a URL that you include in the payload of your push notification. By requesting that URL the server knows that the receiver received the push notification and can pass this status on to your sender application.

Like so:

  1. Add a specific URL in your push notification payload
  2. Implement the application:didReceiveRemoteNotification:fetchCompletionHandler: method in your app delegate and in that method call the URL from the payload.
  3. Implement a logic on your server that recognizes the URL call as a received notification
  4. Let your sender application continuously get the current notification status from the server.
Share:
26,299
user1273189
Author by

user1273189

Updated on January 22, 2020

Comments

  • user1273189
    user1273189 over 4 years

    I have already asked related question: any option to know if apple app get the push notification?

    And I got an answer that it is not possible to know if push notification comes to the iPhone when application is in the background and the user does not have it opened...

    But I found something interesting: I take 2 iPhones with WhatsApp. I open, in the first iPhone, WhatsApp and exit it (the WhatsApp is in the background now), then with the second iPhone, I send WhatsApp massage to the first iPhone.

    When the push notification of WhatsApp reaches first iPhone I can see two "V" (symbols) near to the message (and I don't open the Push notification). After this I close the Internet & 3G in the first iPhone and again send WhatsApp message with the second iPhone to the first one. - and I can see only one "V" near to the massage (not read - not get push notification).

    Now after re-enabling the Internet on the first iPhone and after I get the push notification I can see two "V" (again - I don't open the push notification).

    How does it work? How does WhatsApp know whether the iPhone gets the push notification or not while the WhatsApp works in the background?