Like you wrote in your question, this is mentioned in the Apple Docs:
If you are sending multiple notifications to the same device or
computer within a short period of time, the push service will send
only the last one.
Link
The only scenario that what you're describing will work is if your whatsApp was open in the background while getting those push notifications
. That way whatsApp will handle them as local notifications
and will present all of them in the notification center. If whatsApp was closed you'd get only the last notification like any other app.
You can easily test this:
- Terminate whatsApp and turn on
Airplane mode
.
- Send your device 5 messages from 1 to 5.
- Turn
Airplane mode
off and lock your device.
- You'll only see one msg (the last one you sent aka "5") in your
notifications center
.
This is how whatsApp is making it work:
While whatsApp is in the background, a single push notification is received (the last one the user sent, "5" in our example). That msg will not be shown to the user.
whatsApp receives it in the method application:didReceiveRemoteNotification:fetchCompletionHandler:
and checks against their servers if there are any notifications prior to "5" that the user didn't receive. If that's the case, they will pull that data from their servers and will present it to the user using local notifications
which is basically just a way to present data and not related to APNS at all.