I have made an app template that sends commands and replays via Firebase push messages.
I'm sending just "data", without "notification".
0) Starter service is Foreground service.
1) When screen is on - all works OK, commands are sent and received and replied OK.
2) Also i use PhoneWakeState.PartialLock
3) And on the test device the app is setup without power limitation, and Internet without linitation. It's Android 9 and WiFi connection.
4) And if to switch the screen off, after several mins - no reply from this second device if to send a command.
5) If to switch the screen on - the reply (to those command) is immediately received.
Who tried to develop the same apps - is it correct situation ? Is Firebase sleeping and push can be delivered only if user is active ?
UPD: also started another app that 3 times per minute sends accelerometer info to my server (also with PartialLock) - it worked (whole week) and works now OK with the screen off.
And FB push stopped to work after several mins, but my accel app is working as should... So, WiFi-internet is working all the time OK.
But i think that pushes must work anytime, who did and knows ?
Push notifications feature is an OS feature. You don't need to keep your app running to receive notifications.
However if the device turns off the wifi communication to save power and there is no cellular then you will not receive messages.
The task is the remote control, so i need the app that for sure is "online", with help of FCM. So, task to make it working for sure with the screens off.
And again, Erel - the WiFi is working OK, as another my app is sending data to my server 3 times per minute, whole the week.
And "notification" is not needed, just "data" transfer is required "online forever".