Home > Net >  Prevent System From Killing Background App
Prevent System From Killing Background App

Time:10-11

Hello I have an App for tracking a queue, so when a queue is called, it will send a notification from FCM to any other user in that queue. My question is, if the system kill my apps when running in the background (I read that android will kill background app periodically), will I be able to receive that notification? And if its not, then is there any solution to keep my app from being killed by the system? Thank you.

CodePudding user response:

Yes, you'll get the message. The actual message is sent over the network from Google's servers to a process on the device that is not subject to being killed (its part of Android). That process will restart your application by calling the approprate BroadcastReceiver when a message comes in. Please note that if the message is not high priority it will be subject to Doze mode rules. As long as your device is not turned off/loses network connectivity it will be received.

  • Related