Skip to content
pubscout

firebase_messaging_handler

2.0.0, released 2 months ago by afewgoodcoders.com

Unified Firebase Cloud Messaging handler with inbox, scheduling, and in‑app messaging for Flutter

WASM-ready
$ flutter pub add firebase_messaging_handler
Source repository

What it does

It wraps firebase_messaging and flutter_local_notifications to provide a single API for receiving, displaying, and managing push notifications, including local scheduling, inbox persistence, and in‑app message rendering.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a consistent notification flow across platforms
  • You want an inbox or preference center for notifications
  • You need local scheduling or inline replies
  • You want a single payload contract for server and client

Skip it when

  • You only need basic FCM delivery
  • You prefer to handle notifications entirely manually
  • You are targeting a platform that does not support the required native features

Strengths

  • Comprehensive notification lifecycle management
  • Built‑in inbox and preference center
  • Supports local scheduling and inline replies
  • Provides runtime capability reporting and diagnostics

Weaknesses

  • Adds dependency on multiple native plugins
  • Requires platform configuration and permissions
  • May be overkill for simple notification needs

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
7

Add firebase_core, firebase_messaging, flutter_local_notifications, and configure platform files (google-services.json, AppDelegate, etc.). Request runtime notification permission on Android 13+. No build_runner needed.

```dart
import 'package:firebase_messaging_handler/firebase_messaging_handler.dart';

await FirebaseMessagingHandler.instance.initialize();
FirebaseMessagingHandler.instance.onNotificationOpened.listen((event) {
  // navigate to appropriate screen
});
```

Alternatives

Packages that do the same job and could replace firebase_messaging_handler.

Works with

Packages commonly used together with firebase_messaging_handler: ones it builds on, ones built on it, and its own family.