I am building an attendance app in Flutter where:
When a user marks attendance, the record is saved locally (Isar).
A cron job (every 15 sec) pushes local data to the server.
If the app is alive (foreground or background), this sync works fine.
Problem:
If the app is terminated or device is in battery saver / Doze mode, WorkManager does not run reliably. The server never gets the new attendance until the app is opened again.
What I need (real-world scenario like WhatsApp)
I want guaranteed sync even if:
App is terminated / killed by user
Device is in Doze mode / Battery saver
Server was temporarily down (app should retry later)
Attempts so far
✅ Used workmanager → works in background, but unreliable in terminated + battery saver mode.
I am building an attendance app in Flutter where:
When a user marks attendance, the record is saved locally (Isar).
A cron job (every 15 sec) pushes local data to the server.
If the app is alive (foreground or background), this sync works fine.
Problem:
If the app is terminated or device is in battery saver / Doze mode, WorkManager does not run reliably. The server never gets the new attendance until the app is opened again.
What I need (real-world scenario like WhatsApp)
I want guaranteed sync even if:
App is terminated / killed by user
Device is in Doze mode / Battery saver
Server was temporarily down (app should retry later)
Attempts so far
✅ Used workmanager → works in background, but unreliable in terminated + battery saver mode.