Skip to content

v1.2.6: Industrial Stability & Foreground Service (FGS) Bypass

Choose a tag to compare

@vietnguyentuan2019 vietnguyentuan2019 released this 09 May 03:52
· 183 commits to main since this release

🚀 Version 1.2.6: Industrial-Grade Background Reliability

This release marks a major milestone in production stability, introducing industrial-grade mechanisms to bypass modern OS background restrictions and eliminating critical concurrency issues.

🌟 Key Highlights

🛡️ Android: Industrial Foreground Service (FGS) Bypass

Run heavy, long-running tasks without being killed by Android 12+ battery optimizations.

  • Priority Execution: Promotes tasks to system-level Foreground Services.
  • Custom Notifications: Full control over title, body, and action buttons (e.g., 'Stop Sync').
  • Android 14 Ready: Automatically handles FGS types and required system permissions.

⚡ Android: Expedited Work (Locked Device Support)

Resolved the regression where tasks wouldn't fire when the screen was locked.

  • Doze Mode Bypassing: Maps allowWhileIdle: true to WorkManager's Expedited Work.
  • Instant Triggering: Tasks fire reliably even on idle or locked devices.

💎 iOS: Swift Concurrency & Deadlock Fixes

  • Serial Database Queues: Migrated all SQLite stores to serial queues to eliminate deadlocks.
  • Scheduling Reliability: Integrated micro-delays for complex TaskGraph chains to ensure BGTaskScheduler registration success.

🛠 Full Change Log

Added

  • Android: Industrial-grade Foreground Service support via ForegroundNotificationConfig.
  • Android: Proactive task promotion using setForeground() for immediate background execution.
  • Android: Full compliance with Android 14 (API 34) Foreground Service Types.
  • Example: New 'FGS Bypass' demo page showing real-time priority task execution.

Fixed

  • Android: Fixed regression where background tasks would not fire on locked devices (#28).
  • iOS: Fixed Swift Concurrency deadlocks affecting OfflineQueue and TaskGraph.
  • iOS: Synchronized background task identifiers between Swift code and setup scripts.
  • Test: Platform-aware integration test suite with automatic iOS Simulator isolation.

Documentation

  • Architecture: Deep-dive into v1.2.6 reliability enhancements in ARCHITECTURE_ANALYSIS.md.
  • Concurrency: Defined new serial-queue threading contract in CONCURRENCY.md.
  • Migration: Step-by-step guide for using new FGS features.

📦 Installation

Update your pubspec.yaml:

dependencies:
  native_workmanager: ^1.2.6

Note for Android: To ensure tasks survive app kills, please ensure your Application class implements Configuration.Provider as described in our Android Setup Guide.