WhatsApp implemented end-to-end encryption (whitepaper) in their latest update.
How is it possible for WhatsApp to send push notifications with message contents to the Apple Push Notification service?
One possible solution would be to send the unencrypted message to APNs from within the app itself but this would be open to abuse and would defeat the purpose of end-to-end encryption.
I have just tested it a bit more, according to Apple's documentation:
However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again.
Which I tested, and resulted in me still receiving the plain text push notifications. This would lead me to believe the app is not running in the background to decrypt any notifications received and then repost them.
I have now used the VoIP API ( as mentioned in the answers below ) to effectively achieve the same result myself in a demo app. Works very well.
Apple no longer allows the usage of the API for push notifications of non-VOIP apps. They do however allow WhatsApp to do it in their infinite fairness.
Update September 2018:
A notification application extension can now be used to decrypt push notifications. However, dynamic libraries are discouraged from use in such extensions so you must have a codebase that can be compiled statically for decryption etc.