Reputation: 337
I want my app to keep running in the background to send the user location to the firebase. I'm using background_locator plugin for this purpose. But the problem is that when the phone is locked the app runs fine in the background for few minutes (30 mins approx in high end devices & 4-5 hrs approx on older android devices) and stops. And when i turn ON the screen the app starts to run again. until then the app will be paused after running for few minutes from the time when the phone is locked.
Upvotes: 1
Views: 1465
Reputation: 1193
try the following flutter package (android only)
background_mode: ^1.0.1
and in your main page init state method call this
BackgroundMode.start();
Upvotes: 1