0
votes

In order to check if a person is still 'online' in some kind of chat app, we use Firebase to send a FCM high priority and the device should answer in the next seconds.


In the documentation, we can read

FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when necessary and to run some limited processing (including very limited network access).

  • It works between 30 minutes to few hours, but at some point the network is not accessible from the phone and I am receiving a socket timeout. My app is set as 'not optimized' in the battery section.

  • I even try to start a WorkManager job with a 'NetworkType.CONNECTED' constraints, but even with that I have a timeout after some time.

Any idea of how to avoid these timeouts ? And what Firebase means by 'very limited network access' ?

1

1 Answers

0
votes

I've faced a similar problem. My app is also set as not optimized in battery optimization section. Then I also set google play services as not optimized. And if you are connecting your device with wifi then set wifi to be enabled even in deep sleep mode. However, LTE works fine even with device in sleep.