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
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.
- firebase_in_app_messaging
Flutter plugin for Firebase In-App Messaging campaigns.
93Compare - firebase_messaging_web
Web implementation of Firebase Cloud Messaging for push notifications.
84Compare - flutter_local_notifications_linux
Linux implementation of the flutter_local_notifications plugin.
81Compare - push
Push notifications in Flutter without firebase_messaging for Android, iOS and macOS.
62Compare
Works with
Packages commonly used together with firebase_messaging_handler: ones it builds on, ones built on it, and its own family.
- shared_preferencesfirebase_messaging_handler depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- firebase_corefirebase_messaging_handler depends on itFlutter plugin that initializes Firebase and allows multiple Firebase app connections.
- timezonefirebase_messaging_handler depends on itTime zone databases and time zone aware DateTime class in Dart.
- firebase_messagingfirebase_messaging_handler depends on itFlutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
- flutter_local_notificationsfirebase_messaging_handler depends on itCross-platform plugin for displaying and scheduling local notifications.
- flutter_timezonefirebase_messaging_handler depends on itA flutter plugin for getting the local timezone of the device.
- flutter_widget_from_html_corefirebase_messaging_handler depends on itRender HTML content as native Flutter widgets with correctness and extensibility.
- firebase_updateSame familyForce update, maintenance mode and patch notes via Firebase Remote Config for Flutter apps