I'm currently developing an Android application using the Mesibo platform, and I've encountered an issue with push notifications. Specifically, when the app is killed from the recent apps list, it does not show any push notifications.
This is the source code I used:
Mesibo SDK Version: 2.7.16
Android Version: 14
The app works fine when it is in the background or foreground, receiving notifications as expected. Is there a specific configuration or setting that I might be missing to ensure that Mesibo can deliver push notifications even when the app is killed from the recent apps list? Any insights or solutions would be greatly appreciated!
Thank you in advance for your help!
I'm currently developing an Android application using the Mesibo platform, and I've encountered an issue with push notifications. Specifically, when the app is killed from the recent apps list, it does not show any push notifications.
This is the source code I used:
Mesibo SDK Version: 2.7.16
Android Version: 14
The app works fine when it is in the background or foreground, receiving notifications as expected. Is there a specific configuration or setting that I might be missing to ensure that Mesibo can deliver push notifications even when the app is killed from the recent apps list? Any insights or solutions would be greatly appreciated!
Thank you in advance for your help!
Share Improve this question asked Feb 18 at 3:15 Eko YuliantoEko Yulianto 3043 silver badges8 bronze badges 1- Please edit the question to provide code as text, not as a screenshot Make sure you properly format it using a code block. – tyg Commented 2 days ago
1 Answer
Reset to default 1mesibo's server doesn't know or care how your app was terminated (whether it was killed, crashed, force-stopped or simply is in background). If you have configured push credentials in the mesibo console (which I assume you have since you're receiving push in some cases), the server sends push notifications when it detects the user is offline - regardless of your app's state.
In general, mesibo or any server that sends push has no role after sending the push notification to FCM. After that, it's entirely up to FCM and your device's operating system to handle delivery. This is where you need to focus your troubleshooting.
You can use mesibo push webhook to troubleshoot whether mesibo sent push or not. mesibo does apply push rate limits to prevent your apps from getting throttled by FCM or APN and resets rate limits after the user is online. Alternatively, try with your own custom script bypassing mesibo.
Refer to the mesibo push troubleshooting guide here: https://docs.mesibo/api/push-notifications/troubleshooting/ If you are using mesibo on-premise, view console logs for push results.
The most important thing is to ensure that after push is received, your app remains active while the push is being processed. If not, your app received push and before it can act upon it, the OS puts it back to sleep - which is as good as if the push was not received. This is likely what's happening when the app is killed.
Here are various approaches to keep your app awake after receiving push, for example,
JobIntentService (deprecated in Android 12): mesibo uses this in Android messenger app https://github/mesibo/messenger-app-android/blob/master/app/src/main/java//mesibo/messenger/fcm/MesiboGcmListenerService.java
https://github/mesibo/messenger-app-android/blob/master/app/src/main/java//mesibo/messenger/fcm/MesiboJobIntentService.java
WorkManager which is a replacement for JobIntentService
Start a foreground service
Use WakeLocks to keep device awake while processing push
You can research them and use whichever is suitable for your needs.
Remember, there are various factors that can prevent delivery when an app is killed. Many Android manufacturers (particularly Xiaomi, Huawei, Samsung, etc.) implement aggressive battery saving features that can block FCM messages when an app is not running. You can cross-check with other apps to see if they have the same issue. However, testing push notifications during development can be tricky due to rate limits. Even standard Android has battery optimization features that can affect push delivery.