firebase_notifications_handler
3.0.3, released 3 months ago by rithikbhandari.dev
Handle Firebase Cloud Messaging notifications with built-in local notifications support.
What it does
Provides a widget-based approach to handle Firebase Cloud Messaging and display local notifications when the app is in the foreground, background, or terminated. It exposes callbacks and streams to manage notification events, taps, tokens, and custom sounds.
AI-written summary of version 3.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to display Firebase push notifications while the app is in the foreground without extra setup.
- You prefer a widget-based approach to manage notification callbacks and data.
- You need built-in stream subscriptions for notification taps and incoming messages.
Skip it when
- You are not using Firebase Cloud Messaging for push notifications.
- You want to avoid native configuration steps like enabling core library desugaring on Android.
Strengths
- Foreground notification display without extra boilerplate.
- Widget-based approach that integrates with Flutter's UI architecture.
- Built-in streams for notification arrivals and taps.
Weaknesses
- Requires platform-specific setup including Android core library desugaring and minimum SDK version 24.
- Re-exports major versions of underlying packages, making breaking changes cascade.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 6
Requires Android minSdk 24, enabling core library desugaring in build.gradle, Java 17 compatibility, and Firebase project configuration.
FirebaseNotifications(
child: MyApp(),
onTap: (notificationInfo) {
// Handle notification tap
},
)Alternatives
Packages that do the same job and could replace firebase_notifications_handler.
- onesignal_flutter
If you prefer a comprehensive third-party push notification provider instead of Firebase.
82Compare
Works with
Packages commonly used together with firebase_notifications_handler: ones it builds on, ones built on it, and its own family.
- path_providerfirebase_notifications_handler depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- timezonefirebase_notifications_handler depends on itTime zone databases and time zone aware DateTime class in Dart.
- firebase_messagingfirebase_notifications_handler depends on itFlutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
- flutter_local_notificationsfirebase_notifications_handler depends on itCross-platform plugin for displaying and scheduling local notifications.
- firebase_phone_auth_handlerSame familyEasy Firebase phone authentication with OTP sending, verification, and auto-fetch support.