Skip to main content

Posts

Showing posts with the label Firebase Cloud Messaging

Solving Flutter FCM Background Notifications on Android 14

  There is no frustration quite like a push notification that works perfectly in debug mode but vanishes in a release build. You see the logs verify the payload was sent, Firebase Console reports a success, yet the device remains silent. With the release of Android 13 (API 33) and the stricter policies of Android 14, the rules for background execution and notification delivery have changed fundamentally. If your Flutter app fails to wake up from a "Terminated" or "Background" state, it is likely due to a collision between Dart's isolate lifecycle and Android's battery optimization intent filters. This guide provides a rigorous, production-ready implementation to guarantee FCM delivery on Android 14, covering the necessary native configuration, Dart entry points, and payload structuring. The Root Cause: Why Notifications Fail on Android 14 To fix the issue, we must understand the architectural bottleneck. When a Flutter app is "terminated" (swiped a...