firebase_messaging
17.1.0, released 4 days ago by firebase.google.com
Flutter plugin for Firebase Cloud Messaging to deliver messages on Android, iOS, web, and macOS.
What it does
Allows Flutter apps to reliably receive and handle cross-platform push notifications and cloud messages using the Firebase Cloud Messaging API. It supports background message delivery, handling notification taps, and FID registration APIs.
AI-written summary of version 17.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need reliable push notification delivery across Android, iOS, web, and macOS.
- Your application backend is already integrated with Firebase.
Skip it when
- You do not use Firebase services in your application stack.
- You only require purely local notifications without backend push support.
Strengths
- Official, well-maintained Firebase plugin with Flutter Favorite status.
- Cross-platform support including Android, iOS, web, and macOS.
Weaknesses
- Requires platform-specific configuration and Firebase setup.
- Breaking changes can occur with major version bumps of Firebase SDKs.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 5
Requires configuring Firebase in your project, adding platform-specific setup (like iOS UNUserNotificationCenter delegate and APNs registration), and setting the minimum Android SDK version to 24.
FirebaseMessaging messaging = FirebaseMessaging.instance;
NotificationSettings settings = await messaging.requestPermission(
alert: true,
badge: true,
sound: true,
);
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print('Got a message whilst in the foreground!');
print('Message data: ${message.data}');
});Alternatives
Packages that do the same job and could replace firebase_messaging.
- az_notification_hub
Flutter plugin for Azure Notification Hubs cross-platform push messaging.
66Compare - flutter_local_notifications_linux
Linux implementation of the flutter_local_notifications plugin.
81Compare - toastification
Flutter toast and notification widget library
91Compare - push
Push notifications in Flutter without firebase_messaging for Android, iOS and macOS.
62Compare
Works with
Packages commonly used together with firebase_messaging: ones it builds on, ones built on it, and its own family.
- firebase_corefirebase_messaging depends on itFlutter plugin that initializes Firebase and allows multiple Firebase app connections.
- firebase_messaging_webfirebase_messaging depends on itWeb implementation of Firebase Cloud Messaging for push notifications.
- firebase_core_webSame familyWeb implementation of firebase_core for Flutter apps.
- firebase_analyticsSame familyFlutter plugin for Google Analytics for Firebase.
- firebase_crashlyticsSame familyFlutter plugin that sends uncaught errors and crash reports to Firebase Crashlytics.
- firebase_authSame familyFlutter plugin for Firebase Authentication enabling passwords, phone numbers, and identity providers.
- firebase_auth_webSame familyWeb implementation of Firebase Authentication for Flutter
- cloud_firestoreSame familyFlutter plugin for Cloud Firestore noSQL database with live synchronization.