I had the same problem to solve in one of my projects. Unfortunately, Flutter does not provide any way to implement always-on service. Moreover, iOS does not allow anything like this unless you are running some predefined services like Music Player.
So we can implement this natively as follows(with some limitations on iOS):
Android:
I implemented Foreground Service in Android. https://developer.android.com/guide/components/services#StartingAService
Then, I used MethodChannels to start and stop the service from Flutter. https://flutter.dev/docs/development/platform-integration/platform-channels
iOS:
Only specific background tasks are allowed on iOS. Check below:
CLICK HERE to find out more related problems solutions.