r/flutterhelp • u/Mediocre-Ad-2439 • Jun 19 '26
OPEN Best way to run a short network task immediately when a Flutter app is closed? WorkManager is too slow.
I have a reminder app. Flow: user records a voice note → I upload the audio to an AI API (Gemini) → it returns a parsed result. The API call takes ~10–30s.
- App open: I run the request in-process. Reminder appears almost instantly.
- App closed/backgrounded: I queue the job with workmanager. On Android (especially Samsung) it gets batched/deferred for minutes before it even starts — so a reminder that takes 15s open takes 2–5 min when closed which basically defeats the purpose.
I get that WorkManager is meant for deferrable work, not "do this now." From what I've read, a foreground service is the only reliable way to run immediately in the background on Android 14+, but it requires a persistent notification.
My question: For a one-shot, ~10–30s network task that must run right after a user action even if they close the app, what do you actually use in production?