FCM doesn't work when my App is in "App Standby mode"

420 views Asked by At

I'm building an Android App that implements a chat using the Sendbird service. Sendbird uses the FCM (Firebase Cloud Messaging) to send the notifications of a new messages received when the App is in background.

All works fine if the Android Energy Saving is disabled, but if this is active, I don't receive notification for some messages.

If I put my App in background and set it in "AppStandby mode" as suggested in Android Developer page ( https://developer.android.com/training/monitoring-device-state/doze-standby ), I saw that FCM doesn't work and my notifications messages are lost.

I used the following shell commands:

$ adb shell dumpsys battery unplug
$ adb shell am set-inactive <packageName> true

Instead all works fine when my App is in "Doze mode".

Because it's the Sendbird server that send to my App the notifications, by FCM, I can't set High priority of messages and I also think that High Priority is not the correct way to solve the problem.

Anyone has an idea for solve the problem? Help me please!!!!

0

There are 0 answers