套件概覽
一個 Flutter 插件,可在 Android 上啟用前臺服務功能,特別支援 Android Oreo 及以上版本。它允許應用在背景執行任務並顯示持續通知,確保即使應用不在前景也能持續運作。此插件專為需要長時間運行操作的場景設計,例如定位追蹤、音樂播放或檔案下載。目前不支援 iOS。它與 Flutter 的平台通道無縫整合,並提供簡單的 API 來啟動和停止前臺服務。
適用情境
- Background location tracking
- Long-running file downloads
- Music playback in background
- Real-time data synchronization
- Persistent task execution
主要特色
- Android Oreo+ only
- Persistent foreground notification
- Simple start/stop API
- Platform channel integration
- No iOS support
適合對象
- Apps needing persistent background execution
- Location-based services
- Media players
- Task schedulers
- Background data processing
使用建議
- Not compatible with iOS
- Requires Android Oreo or higher
- Must display a persistent notification
- Limited to Android platform
- May impact battery life