This post is only for users using jailbroken devices and not a sideloaded IPA
The problem
A delay in receiving push notifications when WhatsApp is closed or in background, especially after upgrading to WhatsApp 22.8.75
.
Why?
WhatsApp’s ServiceExtension
After WhatsApp dropped support for iOS 9, they started using an application extension called ServiceExtension
, responsible to receive push notifications from the server, decrypt them, store messages in database, send delivery receipts, and display notifications without the need to launch the application in background.
iOS Jetsam
iOS has a built-in process called Jetsam, it is responsible for limiting memory usage by other processes and terminating them when exceeding their limits.
How they are related
The notifications are getting delayed because ServiceExtension
is getting killed by jetsam for exceeding memory limits especially when there are multiple libraries and/or tweaks injected into it.
In addition to WhatsApp’s frameworks (mainly Core.framework
), many jailbreak tweaks will inject into all the system/user processes which can increase their memory usage and hit the limits.
This is a known issue on iOS 13/14 jailbroken devices, where multiple system processes are crashing by jetsam. The reason why you see multiple crash reports inside Cr4shed tweak.
Once the extension is killed, the notifications will not be displayed and no delivery receipts will be sent to server (which is why your contacts will see just one check).
WhatsApp server will automatically resend all messages that are still not delieved to your device, which explains why you are receiving the notifications with a delay. They are now properly received after ServiceExtension
is restarted with lower memory usage that does not hit jetsam limits.
Watusi also injects into ServiceExtension
to have its features working properly, some of these features are:
Disable Delivery Receipts
- these receipts are sent from this extension if the application is closedAuto Reply
- since WhatsApp is not launched when notifications are received, we need to handle active auto replies here- Hide
Hidden Chats
andArchive Lock
notifications which are displayed from within the service extension Private Notifications
content can only be modified from thereBlock Incoming Calls
calls notifications are also displayed from this extension
Possible Solutions
Disable Tweak Injection
You can disable tweak injection into ServiceExtension
using Choicy
tweak which might help reducing memory usage from injected tweaks.
Disabling tweak injection will cause some of Watusi features (mentioned above) to not work properly.
- Go to
Choicy Settings
>Applications
> search and selectWhatsApp
- Click
App Plugins
and selectServiceExtension
- Enable
Disable Tweak Injection
You can also enable Custom Tweak Configuration
and allow only Watusi
libray to load.
Resetting WhatsApp Database
Some users were able to solve this issue by deleting WhatsApp and reinstalling a fresh copy without restoring a chats backup. This helps because WhatsApp is updating the database from within the ServiceExtension.
Increase Jetsam Limits
There is a thread on reddit describing how to increase jetsam memory limits.
I don’t recommend doing it but you can try modifying the file by adding WhatsApp extension to the Extension
array with a higher memory limit settings. (I did not try it myself)
Reset Location & Privacy
Other users reproted that resetting their device’s Location & Privacy
from Settings
> General
> Reset
helped with this issue.
Downgrade WhatsApp
As a temporary solution, you can downgrade WhatsApp to version 22.7.80
using AppStore++ tweak.
Summary
This issue was fixed in recent WhatsApp updates until version 22.8.75
, in which they most probably moved more functionality to the ServiceExtension
(especially after enabling Linked Devices
feature for everyone), making it hitting the memory limits more often.
I’m working on writing a more lightweight version of Watusi to be injected into ServiceExtension
which would help from hitting memory limits.
This problem is also happening to some non-jailbroken users on older devices.