firebase-messaging

Integrate Firebase Cloud Messaging push notifications in Flutter apps.

611|60|Updated Apr 22, 2025
One-click install
npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-messaging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firebase-messaging
Source: https://github.com/evanca/flutter-ai-rules/tree/main/skills/firebase-messaging
Command: npx skills add https://github.com/evanca/flutter-ai-rules --skill firebase-messaging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps Flutter developers implement reliable push notifications using Firebase Cloud Messaging (FCM), including handling foreground and background messages, managing user permissions and device tokens, and configuring platform-specific notification behavior.

Core Features & Use Cases

  • Integrates Firebase Cloud Messaging into a Flutter project for cross-platform push notifications.
  • Handles foreground, background, and terminated message delivery and display.
  • Manages notification permissions and token lifecycle to support targeted messaging.
  • Configures platform-specific behavior for iOS, Android, and Web, including service workers on the web.

Quick Start

Add the firebase_messaging dependency to your Flutter project and initialize Firebase, then start listening for messages with FirebaseMessaging.instance.

Frequently Asked Questions about firebase-messaging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Firebase Cloud Messaging notifications in Flutter when the app is in the background?

Firebase Cloud Messaging handles background notifications in Flutter by configuring platform-specific settings and registering a top-level background handler. This ensures reliable message delivery and display when the app is terminated or running in the background.

What is the best way to set up push notifications for Flutter across iOS, Android, and Web?

Setting up cross-platform push notifications in Flutter involves integrating Firebase Cloud Messaging. You add the firebase_messaging dependency, configure platform-specific settings like iOS permissions and Web service workers, and initialize Firebase for accurate messaging.

How do I manage user permissions and device tokens for FCM in a Flutter app?

Managing user permissions and device tokens for FCM in Flutter involves requesting notification authorization and retrieving tokens via FirebaseMessaging.instance. This token lifecycle management supports sending targeted push messages to specific devices.

Does firebase_messaging support foreground message delivery in Flutter?

Firebase Messaging supports foreground message delivery in Flutter. You listen for incoming messages and configure their display directly within the app using FirebaseMessaging.instance while the application is actively running.

Why are my FCM push notifications not showing up on iOS?

FCM push notifications may not show up on iOS if platform-specific settings are incomplete. You must properly configure iOS notification permissions and initialize Firebase accurately to ensure reliable foreground and background message delivery.