0

I have developed a react-native app for Android to receive real time food orders (like Uber Eats, Postmates, etc.). The app is running in a Lenovo tablet that is constantly charging. I use a GraphQL subscription to detect new orders and Firebase Cloud Notifications to check the network status of the tablet.

The problem is that right now the system eventually kills the app after some days with no interaction. I would like to know the best approach to prevent the systems kills the app and being able to run it 24/7 in this case scenario.

Thanks!

Iván
  • 169
  • 5
  • You have provided nowhere near enough information or code for anyone to suggest a solution. We need to know a lot more but perhaps you could use notifications to wake your app up when a user selects one. That's the normal way. Android will kill what it wants when it wants if it feels the need so you will never keep an app running. – jamesc Sep 02 '19 at 19:49
  • Yes, we use notifications to restart remotely the application when the socket is disconnected. We also send a notification every hour to check network status. The thing is that the system still kills the app after some days (the app appears on background but is not running anymore). – Iván Sep 02 '19 at 20:02

1 Answers1

0

You should write a service for your app, which starts the app when it gets killed.Never ending service has a good tutorial on how to do this.

Sam
  • 31
  • 4