Skip to main content
RapidDev - Software Development Agency
flutterflow-integrationsFlutterFlow Native Integration

Firebase Cloud Messaging

Connect FlutterFlow to Firebase Cloud Messaging (FCM) using FlutterFlow's built-in native Push Notifications feature — once your project is connected to Firebase, FCM device token registration is automatic. Receiving notifications requires enabling Push Notifications in FlutterFlow Settings. Sending triggered notifications requires a Firebase Cloud Function using the Admin SDK HTTP v1 API, since the legacy server key is deprecated and the privileged send endpoint cannot be called from the client.

What you'll learn

  • How to enable FCM push notifications natively in FlutterFlow with a single settings toggle
  • How to upload an APNs .p8 key to Firebase for iOS push notification delivery
  • How to send test notifications from the Firebase console to verify the setup
  • How to write a Firebase Cloud Function that sends triggered notifications via the FCM HTTP v1 API
  • How to handle notification taps to navigate users to specific pages in your FlutterFlow app
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner16 min read30 minutesDatabase & BackendLast updated July 2026RapidDev Engineering Team
TL;DR

Connect FlutterFlow to Firebase Cloud Messaging (FCM) using FlutterFlow's built-in native Push Notifications feature — once your project is connected to Firebase, FCM device token registration is automatic. Receiving notifications requires enabling Push Notifications in FlutterFlow Settings. Sending triggered notifications requires a Firebase Cloud Function using the Admin SDK HTTP v1 API, since the legacy server key is deprecated and the privileged send endpoint cannot be called from the client.

Quick facts about this guide
FactValue
ToolFirebase Cloud Messaging
CategoryDatabase & Backend
MethodFlutterFlow Native Integration
DifficultyBeginner
Time required30 minutes
Last updatedJuly 2026

Push Notifications in FlutterFlow: Native FCM Integration

Firebase Cloud Messaging is one of the few truly native integrations in FlutterFlow — you do not need to write any API Call groups or custom Dart code to receive push notifications. Once your FlutterFlow project is connected to Firebase (via Settings → Firebase), toggling on Push Notifications in Settings automatically adds the required FCM libraries, handles platform permission prompts, registers device tokens, and stores them on the users collection in Firestore. This means the most complex part of push notification setup — token lifecycle management — is handled for you.

Where founders often get confused is on the sending side. There are two scenarios: sending a broadcast or segmented campaign (use the Firebase console's Notification Composer), and sending a triggered notification in response to an in-app event (for example, notifying a user when someone sends them a message). The second scenario requires a backend — specifically a Firebase Cloud Function using the Admin SDK. The reason: the FCM HTTP v1 API requires a service account credential to authorize requests. A service account JSON key is a secret and must never be in your Flutter app. The legacy FCM server key (which was easier to misuse) is deprecated as of 2024; you must use HTTP v1 with a service account.

FCM itself is free with no per-message charge. Cloud Functions require the Firebase Blaze (pay-as-you-go) plan, which has no default spending cap — set a budget alert in the Firebase console immediately after upgrading. The free Blaze grant covers 2 million function invocations per month, so costs are typically negligible until you reach significant scale.

Integration method

FlutterFlow Native Integration

FlutterFlow has first-class built-in support for Firebase Push Notifications. Enabling Push Notifications in Settings automatically handles FCM device token registration, permissions prompts, and token storage on your users — no custom code needed for the receive side. Sending targeted or triggered notifications requires a Firebase Cloud Function using the FCM HTTP v1 API and the Admin SDK, because the privileged send endpoint requires a server-side service account that must never be exposed to the client. FCM itself is free; Cloud Functions require the Firebase Blaze plan.

Prerequisites

  • A FlutterFlow project connected to Firebase (Settings → Firebase → connect your project)
  • A Firebase project on the Blaze plan if you plan to use Cloud Functions for triggered sends (free tier works for receive-only)
  • An Apple Developer account with an APNs auth key (.p8 file) if you need iOS push notifications
  • Basic familiarity with FlutterFlow's Settings panel

Step-by-step guide

1

Connect the FlutterFlow project to Firebase

Before enabling push notifications, your FlutterFlow project must be connected to a Firebase project. If you have not done this yet, open your project in the FlutterFlow editor and click Settings in the left navigation panel, then scroll to Firebase. Click Connect Firebase and follow the prompts to link your Firebase project — FlutterFlow will auto-generate the google-services.json (Android) and GoogleService-Info.plist (iOS) configuration files and add them to the project. If your project is already connected to Firebase, confirm this by checking Settings → Firebase — it should show your project ID. You should also verify that Firestore is enabled in your Firebase console (Authentication and Firestore Database should be active, as FlutterFlow stores FCM tokens in the users Firestore collection by default). If you do not yet have a users collection set up in Firestore, FlutterFlow will create the token storage automatically when Push Notifications is enabled — but your users must be authenticated (logged in via FlutterFlow's Auth system) for the token to be associated with a user document. If your Firebase project is on the Spark (free) plan, you can still enable Push Notifications for receiving — but you will need to upgrade to Blaze to deploy Cloud Functions for triggered sends later in this guide.

Pro tip: Go to your Firebase console → your project → Project Settings → Your apps to confirm both Android and iOS apps are registered. If they are missing, FlutterFlow's Firebase connection may be incomplete.

Expected result: FlutterFlow Settings → Firebase shows your project ID and 'Connected' status. The Firebase console shows your app registered under Project Settings → Your apps.

2

Enable Push Notifications in FlutterFlow Settings

With Firebase connected, enabling FCM is a single toggle in FlutterFlow. Go to Settings in the left navigation panel → Push Notifications → toggle on 'Enable Push Notifications'. FlutterFlow will automatically add the firebase_messaging Flutter package, configure the necessary platform files, and add logic to request notification permissions from the user at app start. When this is enabled, FlutterFlow handles the full FCM token lifecycle: when a user opens the app, FCM generates a unique device token for that device, FlutterFlow receives it, and stores it in the user's document in your Firestore 'users' collection under a field named 'fcm_tokens' (an array, since a user can have multiple devices). You can see this field appear in your Firestore database once a real user logs in and opens the app. FlutterFlow also lets you configure notification behaviors: click the Push Notifications settings to set the foreground behavior (show a notification banner even when the app is open) and the tap action (which page opens when the user taps a notification). Set the tap action to navigate to the relevant page — for example, a chat app might navigate to the Chat page. You can also add data payloads (key-value pairs) to notifications and read them in the tap action to navigate to specific content (e.g., a specific chat thread ID).

Pro tip: Test that the permission prompt appears on first launch by running the app in Test mode → open on a real device or emulator. The OS permission dialog should appear asking the user to allow notifications.

Expected result: Push Notifications is toggled on in Settings. When you run the app on a device and log in, a notification permission prompt appears. After granting permission, the user's Firestore document shows an 'fcm_tokens' array with the device token.

3

Upload the APNs .p8 key for iOS push notifications

This step is iOS-specific and is the single most common failure point for push notifications. If you skip it, Android notifications will work perfectly but iOS will silently fail — notifications will appear delivered in the Firebase console but never arrive on the iPhone or iPad. To get the APNs auth key, you need an Apple Developer account ($99/year). Log in at developer.apple.com → Certificates, Identifiers & Profiles → Keys → + (Create a new key) → enable 'Apple Push Notifications service (APNs)' → name it (e.g., 'FCM Push Key') → click Continue → Register → Download. The downloaded file has a .p8 extension. Also note the Key ID (shown on the key detail page) and your Team ID (shown in the top-right of the Apple Developer portal under your account name). Now go to your Firebase console → your project → Project Settings → Cloud Messaging tab → scroll to 'Apple app configuration'. Click 'Upload' next to APNs Authentication Key, upload the .p8 file, and enter the Key ID and Team ID. Click Upload. This links FCM to your APNs credentials — Firebase uses this to forward notifications to Apple's delivery system, which then delivers them to iOS devices. If you need to use APNs certificates (.p12) instead of auth keys, the process is similar but less preferred — auth keys do not expire, while certificates expire annually.

Pro tip: The APNs .p8 key can only be downloaded once. If you lose it, you must create a new key and re-upload it to Firebase. Store the downloaded file in a secure password manager or vault immediately.

Expected result: In the Firebase console → Project Settings → Cloud Messaging → Apple app configuration, your APNs key shows as uploaded with the correct Key ID. iOS devices will now receive FCM notifications.

4

Send a test notification from the Firebase console

Before writing any Cloud Function code, confirm the basic setup works by sending a test notification from the Firebase console's Notification Composer. Go to your Firebase console → Engage → Messaging → Send your first message (or + New campaign → Firebase Notification messages). Enter a notification title and body, click 'Send test message', and paste in a device FCM token from your Firestore users collection to target a specific device. To find a test FCM token: run your FlutterFlow app on a real device (or emulator), log in, then go to your Firebase console → Firestore → users collection → find your test user's document → look for the fcm_tokens array. Copy one of the token strings (they are long — about 150 characters) and paste it into the 'Send test message' dialog. Click Test. Within a few seconds, the notification should appear on the device. If it does not appear on iOS, the APNs .p8 key is not set up correctly. If it does not appear on Android, check that the app has notification permission (Android 13+ requires explicit permission). If the Firebase console shows 'Message sent' but the notification never arrives, check the Firebase console → Messaging → More details on recent campaigns for delivery errors. Once the test notification works on both platforms, you have confirmed that the device token storage, APNs key, and FCM delivery chain are all working correctly.

Pro tip: Run the app in the background (not in the foreground) when testing from the Firebase console — foreground notification behavior depends on your FlutterFlow Push Notifications settings and may look different from background delivery.

Expected result: A test notification appears on your real device within a few seconds of clicking 'Test' in the Firebase console. Both Android and iOS devices receive the notification successfully.

5

Add a Cloud Function to send triggered notifications via the Admin SDK

For notifications triggered by app events (new message, new follower, order shipped), you need a Firebase Cloud Function using the FCM Admin SDK. This is where the service account credential lives — server-side, never in your Flutter app. Make sure your Firebase project is on the Blaze plan before proceeding (upgrade in the Firebase console → Project Overview → Spark plan → Upgrade). In the Firebase console, go to Build → Functions → Get started (if this is your first Function). When prompted to initialize the project, use the browser-based approach: click the 'Create function' option rather than following the CLI instructions. If you prefer writing the Function in a code editor and deploying via the CLI, you can do so — but for non-technical founders, the Firebase console's in-browser editor is sufficient for simple notification Functions. Create a Firestore-triggered Cloud Function that fires when a new document is created in your 'messages' collection. The Function reads the recipient's user document from Firestore, retrieves their FCM token(s), and calls the FCM HTTP v1 API via the Admin SDK. The Admin SDK automatically handles service account authentication using the default credentials available in the Cloud Function environment — you do not need to manually configure a service account key inside the Function. Note: the legacy /fcm/send endpoint is deprecated; use admin.messaging().send() from the Admin SDK, which uses the HTTP v1 API internally. If you would rather skip writing Cloud Functions and prefer a visual flow tool, consider using n8n or Zapier to trigger FCM sends via the API — but you will still need to manage the service account credential server-side. RapidDev builds triggered notification Cloud Functions for FlutterFlow apps every week — reach out for a free scoping call at rapidevelopers.com/contact if you hit a wall.

index.js
1// Firebase Cloud Function — send FCM on new Firestore message
2const functions = require('firebase-functions/v2');
3const admin = require('firebase-admin');
4admin.initializeApp();
5
6exports.sendMessageNotification = functions.firestore
7 .onDocumentCreated('messages/{messageId}', async (event) => {
8 const message = event.data.data();
9 const recipientId = message.recipientId;
10 const senderName = message.senderName;
11 const body = message.text;
12
13 // Get recipient's FCM tokens from Firestore
14 const userDoc = await admin.firestore().collection('users').doc(recipientId).get();
15 const userData = userDoc.data();
16 if (!userData || !userData.fcm_tokens || userData.fcm_tokens.length === 0) {
17 console.log('No FCM tokens for user:', recipientId);
18 return null;
19 }
20
21 // Send to all of the recipient's devices
22 const notifications = userData.fcm_tokens.map(token =>
23 admin.messaging().send({
24 token,
25 notification: { title: `New message from ${senderName}`, body },
26 data: { chatId: message.chatId, type: 'new_message' }
27 })
28 );
29
30 return Promise.allSettled(notifications);
31 });

Pro tip: Set a budget alert in the Firebase console (Project Settings → Billing → Alerts) immediately after upgrading to Blaze — Cloud Functions have no default spending cap and unexpected traffic can generate unexpected costs.

Expected result: When a document is created in the 'messages' Firestore collection, the Cloud Function triggers and sends an FCM notification to the recipient's device within 1–3 seconds.

Common use cases

Chat app with real-time message notifications

A FlutterFlow messaging app where users receive push notifications when someone sends them a message. When a message is written to Firestore, a Cloud Function triggers, reads the recipient's FCM token from the users collection, and sends a notification via the FCM HTTP v1 API. Tapping the notification opens the correct chat thread.

FlutterFlow Prompt

Build a one-to-one chat app where users receive a push notification on their device whenever they receive a new message, and tapping the notification opens the conversation.

Copy this prompt to try it in FlutterFlow

E-commerce order status update notifications

A shopping app where customers receive push notifications when their order status changes — 'Your order has shipped', 'Out for delivery', 'Delivered'. A Cloud Function listens for Firestore document updates on the orders collection and sends FCM notifications to the relevant customer's token.

FlutterFlow Prompt

Create a shopping app where customers automatically receive push notifications at each order status milestone — confirmed, shipped, out for delivery, and delivered.

Copy this prompt to try it in FlutterFlow

Event reminder app with scheduled notifications

A community events app that sends push notifications 30 minutes before events the user has RSVPed to. A scheduled Cloud Function runs every few minutes, queries Firestore for upcoming RSVPs, and sends FCM notifications to the relevant users.

FlutterFlow Prompt

Build a community events app that sends users a push notification reminder 30 minutes before each event they have registered for.

Copy this prompt to try it in FlutterFlow

Troubleshooting

Notifications arrive on Android but silently fail on iOS — Firebase console shows 'sent' but iPhone never receives

Cause: The APNs .p8 auth key is not uploaded to Firebase, has expired (if using a certificate), or was uploaded with the wrong Key ID or Team ID.

Solution: Go to Firebase console → Project Settings → Cloud Messaging tab → Apple app configuration. Verify the APNs key is listed and the Key ID and Team ID match your Apple Developer account. If missing or incorrect, delete the existing entry and re-upload the .p8 file with the correct Key ID and Team ID. After updating, wait 2–3 minutes for Firebase to propagate the change.

FCM tokens are not appearing in the users collection in Firestore

Cause: The user is not logged in (FlutterFlow ties FCM token storage to authenticated users), notification permission was denied on the device, or the Push Notifications setting was not enabled before the app was published.

Solution: Verify the user is logged in before expecting the FCM token to be stored. Check the device's notification permission settings (Settings → Notifications → your app → allow). Confirm Push Notifications is toggled on in FlutterFlow's Settings panel and re-publish the app after enabling it. Test on a real device rather than the simulator — FCM tokens cannot be generated on iOS simulators.

Cloud Function fails with 'The default Firebase app does not exist' or authentication error when calling admin.messaging().send()

Cause: admin.initializeApp() is missing, or the Cloud Function is not deployed to the same Firebase project as the FlutterFlow app.

Solution: Ensure admin.initializeApp() is called once at the top of your Functions file before any Function definitions. When using Firebase Cloud Functions Gen 2 (v2), the default credentials are automatically available — you do not need to pass a service account key to initializeApp(). Verify the Function is deployed to the correct Firebase project ID by checking the Firebase console → Functions.

typescript
1// Correct initialization at top of index.js:
2const admin = require('firebase-admin');
3admin.initializeApp(); // No arguments needed in Cloud Functions environment

Error: 'The provided registration token is not registered' when sending via the Admin SDK

Cause: The FCM token in Firestore is stale — tokens change when a user reinstalls the app or clears app data. Sending to an old token fails with this error.

Solution: In your Cloud Function, catch this error code (messaging/registration-token-not-registered) and remove the invalid token from the user's fcm_tokens array in Firestore. On the next app launch, FlutterFlow will automatically generate and store a fresh token. This is normal FCM token lifecycle management.

typescript
1// In Cloud Function: clean up invalid tokens
2const sendResults = await Promise.allSettled(notifications);
3sendResults.forEach((result, i) => {
4 if (result.status === 'rejected' &&
5 result.reason.code === 'messaging/registration-token-not-registered') {
6 // Remove invalid token from Firestore
7 admin.firestore().collection('users').doc(recipientId).update({
8 fcm_tokens: admin.firestore.FieldValue.arrayRemove(userData.fcm_tokens[i])
9 });
10 }
11});

Best practices

  • Never put the FCM server key, service account JSON, or any Admin SDK credential in FlutterFlow or Dart — send notifications exclusively from Cloud Functions or a server you control.
  • Use the FCM HTTP v1 API via the Admin SDK (admin.messaging().send()) rather than the deprecated /fcm/send endpoint with a server key — the legacy endpoint was deprecated in 2024.
  • Upload the APNs .p8 auth key (not the certificate) for iOS — auth keys do not expire annually like certificates, which eliminates a common failure mode.
  • Set a budget alert in Firebase → Project Settings → Billing immediately after upgrading to Blaze — Cloud Functions have no default spending cap.
  • Store FCM tokens as an array per user (not a single field) so notifications reach all of a user's devices — FlutterFlow does this automatically in the fcm_tokens array.
  • Clean up stale FCM tokens in your Cloud Function when you receive a 'registration-token-not-registered' error — this keeps your Firestore clean and your notification delivery rate accurate.
  • Test push notification delivery on real devices, not simulators — iOS simulators cannot receive FCM notifications; Android emulators can but require Google Play Services to be installed.
  • Add data payloads (key-value pairs) to your notifications so the FlutterFlow app can navigate to specific content when the user taps the notification — for example, include chatId to open the correct conversation.

Alternatives

Frequently asked questions

Is Firebase Cloud Messaging free?

FCM itself — the message delivery service — is completely free with no per-message charge. You can send unlimited push notifications to unlimited devices at no cost. The cost comes from Cloud Functions (which you need for triggered sends) — Cloud Functions require the Firebase Blaze pay-as-you-go plan. The Blaze plan includes 2 million free function invocations per month, so most apps pay nothing for Cloud Functions until they scale significantly.

Why do I need a Cloud Function to send notifications? Can't I call the FCM API directly from FlutterFlow?

The FCM HTTP v1 API requires a service account credential (a JSON key) to authorize requests. This credential is a secret — if it's in your Flutter app, anyone who downloads and reverses your APK or IPA can extract it and send fake notifications to your users. The Cloud Function holds the credential server-side using the Admin SDK's auto-credential system, so the key never leaves Google's infrastructure.

My iOS users are not getting notifications. What should I check first?

The APNs .p8 auth key is by far the most common culprit. Go to Firebase console → Project Settings → Cloud Messaging → Apple app configuration and verify your APNs key is uploaded with the correct Key ID and Team ID from your Apple Developer account. If the key is there but notifications still fail, check that your Bundle ID in the Firebase app registration matches the Bundle ID in your FlutterFlow project (Settings → General → App Bundle ID).

Can FlutterFlow send notifications to all users at once (broadcast)?

Yes, through the Firebase console's Notification Composer — you can send to all users, or segment by analytics events and user properties, without writing any code. For programmatic broadcasts from within your app (e.g., an admin button that sends a notification to all subscribers), use a Cloud Function with FCM topic messaging: have users subscribe to a topic and send one FCM message to that topic instead of looping through individual tokens.

What happens when I tap a notification? How do I navigate to a specific page?

In FlutterFlow's Settings → Push Notifications, you can set a default tap action (e.g., navigate to a specific page). For deeper navigation (e.g., opening a specific chat thread), add a data payload to your FCM notification in the Cloud Function (e.g., { type: 'chat', chatId: '123' }). In FlutterFlow, add a custom action in the notification tap handler that reads the data payload and navigates to the correct page with the correct parameters.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire FlutterFlow integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.