Skip to content
pubscout

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.

Flutter FavoriteWASM-ready
$ flutter pub add firebase_messaging
Source repository

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.

Works with

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