๐ก๏ธ lifecycle_guard
The bulletproof Flutter plugin for mission-critical background execution.
Stop losing data when Android or iOS aggressively kills your app.
lifecycle_guard ensures your background tasks survive termination, system reboots, and battery optimizations โ guaranteed.
๐ฌ Demo
Watch lifecycle_guard in action: App swipe โ Background survival โ Task completion.
โจ Features
| Feature | Description |
|---|---|
| ๐ก๏ธ Isolate Protection | Boots a lightweight secondary engine so your task never shares the UI thread fate |
| ๐ค Android 15+ Ready | Fully compliant with new foregroundServiceType: dataSync requirements |
| ๐ iOS Compatible | Bridges to Apple's native background task scheduler |
| ๐ก Zero Data Loss | Tasks continue even when users swipe the app away |
| โก 30-Second Setup | One-line API โ no complex native configuration needed |
๐ Quick Start
Installation
Add to your pubspec.yaml:
dependencies:
lifecycle_guard: ^0.0.1
Usage
import 'package:lifecycle_guard/lifecycle_guard.dart';
// Trigger a mission-critical background task
await LifecycleGuard.runSecureTask(
id: "sync_user_data",
payload: {"userId": "12345"},
);
๐ง How It Works
lifecycle_guard uses a federated architecture to boot a native protected service (Android Foreground Service or iOS Background Task) that runs independently of your app's UI lifecycle.
Full technical details and architecture diagrams at GitHub.
๐ License
BSD 3-Clause License โ see LICENSE for details.
Built with โค๏ธ by Crealify ยท Open to collaborate ยท PRs welcome