The new Android Cached Apps Freezer which is now enabled by default on some Android devices (mostly on Google Pixel devices running Android 14+) can cause notification delivery delays when your app goes to background. Unfortunately, exempting your app from battery optimizations does not actually prevent the Cached Apps Freezer from freezing / terminating your app and delaying notification delivery.
As a workaround, please consider enabling our foreground service functionality specifically on the affected devices to ensure the Pushy Android SDK can keep the connection active when your app goes to background.
The Cached Apps Freezer will not freeze any app that is running a foreground service. The Pushy Android SDK will create a foreground service that the Android OS will never terminate, which will ensure notification delivery in the background and low memory state. In turn, a fully customizable notification will be displayed in the notification bar. It is also possible to instruct your users to easily hide the ongoing notification (see article).
Alternatively, consider enabling FCM high-priority fallback delivery, which makes it possible for devices to receive notifications in real time even with the Cached Apps Freezer enabled. Pushy will attempt to deliver your notifications through MQTT and Firebase Cloud Messaging's high priority channel simultaneously, effectively bursting through all power saving optimizations.