Skip to content

Notifications: improved formatting, assets added, updated content, typo errors fixed #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/troubleshooting/notifications/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Notifications"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
keywords: ['push notifications', 'fcm token', 'troubleshooting', 'cloud functions']
slug: /fcm-token-generation-troubleshooting
title: FCM Token Generation Troubleshooting
---

# FCM Token Generation Troubleshooting

When a user does not have an `fcm_token` sub-collection in their Firestore document, push notifications cannot be delivered to their device. This guide outlines the possible causes and solutions for resolving missing `fcm_token` sub-collections in FlutterFlow apps.

**Understanding the Issue**

Push notifications require a valid Firebase Cloud Messaging (FCM) token, which is generated when a user logs in or signs up on a physical device. This token is typically stored in the `fcm_token` sub-collection of the user document in Firestore. If this sub-collection is missing, the device cannot receive push notifications.

Possible causes for missing tokens include:

- Failures during FCM token generation.
- Incomplete authentication flows.
- Permission issues preventing token creation.
- Invalid input data passed to Cloud Functions.


Here are the steps to verify user eligibility for push notifications:

1. Check Firestore for `fcm_token` Sub-Collection

1. Open the **Firebase Console**.
2. Navigate to **Firestore Database**.
3. Locate the user document.
4. Verify that the `fcm_token` sub-collection exists.

If present, the user is eligible to receive push notifications.

![](../assets/20250430121302960895.png)


### Troubleshooting Missing FCM Token Generation

1. **Verify Cloud Function Execution**

The `addFcmToken` Cloud Function is responsible for generating and storing FCM tokens. If token generation fails, review its logs:

1. Open the **Firebase Console**.
2. Navigate to **Functions**.
3. Locate the `addFcmToken` function.
4. Open its **Logs** to review errors or warnings.

![](../assets/20250430121303270464.png)

2. **Resolve Permission Errors**

Proper permissions are required to allow the Cloud Function to write FCM tokens to Firestore.

**Verify Firebase Security Rules**

- Ensure your Firebase security rules permit writing to the `users` collection and its sub-collections.

**Verify FlutterFlow Service Account Permissions**

The `firebase@flutterflow.io` service account must have the following roles:

- `Editor`
- `Cloud Functions Admin`
- `Service Account User`

**How to Assign Roles**:

1. Open the **Firebase Console**.
2. Go to **Project Settings > Users & Permissions**.
3. Locate the `firebase@flutterflow.io` service account.
4. Assign any missing roles.

Refer to **[this guide](https://intercom.help/flutterflow/en/articles/6570547-setting-up-service-account-permissions-for-push-notifications)** for full instructions.

3. **Validate Input Data Passed to Cloud Function**

If a Cloud Function fails with status code `400`, it may be receiving invalid input data.

- Verify that your authentication flow correctly retrieves the user ID before calling the function.
- Ensure the user ID is not `null`, empty, or malformed.
- Implement conditional validation before invoking the function.
- Add logging to your authentication code and Cloud Functions to trace failures.

This is especially important if you are using custom authentication logic. If you are using FlutterFlow's built-in authentication, this issue is unlikely.

4. **Check for FCM Server Errors**

Additional reasons FCM token generation may fail include:

- FCM server downtime or temporary outages.
- Incorrect or malformed requests sent from the Cloud Function to the FCM server.
- Insufficient API access permissions.
- Invalid or missing input data (e.g. device token).

If server issues persist, consider contacting Firebase support for assistance.

By following this complete troubleshooting process, you can ensure your users successfully receive push notifications.

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
keywords: ['firebase', 'push notifications', 'troubleshooting', 'permissions']
slug: /firebase-push-notification-troubleshooting
title: Firebase Push Notification Troubleshooting
---

# Firebase Push Notification Troubleshooting

Push notifications are essential for keeping users informed through timely alerts and updates. However, several common configuration issues can prevent push notifications from working as expected in FlutterFlow projects. This guide outlines potential causes and solutions.

:::info[Prerequisites]
Before troubleshooting, ensure the following:

- The FlutterFlow app is connected to Firebase.
- The app is installed on a physical device (push notifications do not work on simulators).
- The user is logged in to the app.
- The app is not currently open when testing notifications.
:::

1. **Verify Firebase Blaze Plan Subscription**

- Navigate to **Firebase Console > Project Settings > Usage & Billing > Details & Settings**.
- Confirm that the subscription is on the **Blaze Plan**.
- If the current plan is **Spark**, upgrade by selecting **Modify Plan**.

![](../assets/20250430121514497717.png)


2. Verify Apple Push Notification (APN) Key Configuration

- **Create an APN Key:**

- Navigate to the Apple Developer Console.
- Go to **Certificates, Identifiers & Profiles > Keys**.
- Create a new key for push notifications if one does not exist.

![](../assets/20250430121514756330.png)

Instructions for **[adding a push notification key](https://developer.apple.com/account/resources/authkeys/list)**

- **Upload the APN Key to Firebase**

- Navigate to **Firebase Console > Project Settings > Cloud Messaging > iOS section**.
- Upload the APNs Authentication Key.

![](../assets/20250430121515088626.png)

Instructions for **[uploading APN key to Firebase](https://firebase.google.com/docs/cloud-messaging/ios/certs)**.


3. **Create Push Notification Identifier for Apple**

- Go to the Apple Developer Console.
- Navigate to **Certificates, Identifiers & Profiles > Identifiers**.
- Create or verify an identifier for push notifications.

![](../assets/20250430121515418578.png)

Instructions for **[creating a push notification identifier](https://developer.apple.com/account/resources/identifiers/list)**.


4. **Verify Cloud Permissions for FlutterFlow Service Account**

- Go to **Firebase Console > Project Settings > Users & Permissions**.
- Locate the **firebase@flutterflow.io** service account.
- Ensure the following roles are assigned:

- Editor
- Cloud Functions Admin
- Service Account User

![](../assets/20250430121515666267.png)

Instructions to **[add required cloud permissions](/integrations/firebase/connect-to-firebase/#allow-flutterflow-to-access-your-project)**.


5. **Confirm Cloud Function Region Consistency**

- In **FlutterFlow > Settings > Firebase > Advanced Settings**, verify the Cloud Functions Region matches the region configured in **Firebase > Project Settings > Cloud Functions Location**.

![](../assets/20250430121515990341.png)

![](../assets/20250430121516228961.png)


6. **Update FlutterFlow to Latest Version**

**Refresh FlutterFlow:**

- On Windows: Press `Ctrl + R`.
- On Mac: Press `Cmd + R`.

**Clear Browser Cache:** Clear the browser cache to ensure the latest version loads properly.


7. **Resolve FlutterFlow Insufficient Permissions Error**

If an insufficient permissions error occurs:

1. Open **Firebase Console > Project Settings > Users & Permissions**.
2. Verify the **firebase@flutterflow.io** account exists.
3. Assign the following permissions:

- Editor
- Cloud Functions Admin
- Service Account User

![](../assets/20250430121516955662.png)

4. Save changes and retry the operation in FlutterFlow.

![](../assets/20250430121517242675.png)


Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
keywords: ['firebase', 'web push', 'notifications', 'custom actions']
slug: /firebase-push-notifications-on-web
title: Firebase Push Notifications on Web
---

# Firebase Push Notifications on Web

FlutterFlow currently does not support sending Firebase push notifications on web apps natively. However, Firebase itself supports this capability. This guide outlines alternative approaches to enable Firebase push notifications on web projects built with FlutterFlow.

## Workarounds for Implementing Web Push Notifications

There are two primary methods to implement Firebase web push notifications in FlutterFlow projects:

- **Use Custom Actions:**

- Create custom actions in FlutterFlow that utilize Firebase Cloud Messaging (FCM) to send push notifications.
- This method requires writing custom code to handle notification logic and integrate it into FlutterFlow.
- Custom actions offer flexibility for handling different types of notifications based on the app’s needs.
- The Firebase Web SDK can be used alongside your FlutterFlow project to achieve this.

Refer to official Firebase documentation for detailed steps on **[setting up web push notifications](https://firebase.google.com/docs/cloud-messaging/js/client)**.


- **Use Back-End Functions:**

- Implement server-side code using Firebase Functions or any other backend service.
- Backend functions handle sending notifications independently of the FlutterFlow frontend.
- This approach allows using the Firebase Admin SDK to programmatically send push notifications to targeted web clients.
- Backend solutions also offer better scalability, error handling, and control over notification delivery.

:::note
- Web push notification support requires properly configured Firebase Cloud Messaging, service workers, and valid VAPID keys.
- FlutterFlow may add native support for web push notifications in future updates as the platform evolves.
:::


Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
keywords: ['push notifications', 'firebase', 'cloud functions', 'troubleshooting']
slug: /fix-push-notifications-sent-to-zero-devices
title: Fix Push Notifications Sent to Zero Devices
---

# Fix Push Notifications Sent to Zero Devices

Push notifications allow apps to send updates, alerts, and messages directly to users. In some cases, after triggering a push notification, FlutterFlow displays the following message:

```js
Push Notification sent to 0 devices
```

This means that the notification was attempted, but no eligible devices received it.

Here are the causes:

- No registered devices have generated FCM tokens.
- Target devices were offline at the time of sending.
- Misconfiguration in Firebase or FlutterFlow settings.
- Missing permissions or API configuration.
- Recipient devices have blocked push notifications.

The following steps below outline how to troubleshoot and resolve this issue:

1. **Verify Firebase Functions Are Enabled**

- Ensure that Firebase Functions are enabled in the Firebase Console.
- Confirm that your project is on the Blaze Plan.

![](../assets/20250430121213011292.png)


2. **Delete and Redeploy Firebase Cloud Functions**

- Manually delete the Cloud Functions related to push notifications from Firebase.

![](../assets/20250430121213284704.png)

- After deletion, redeploy Push Notifications from FlutterFlow:

![](../assets/20250430121213612267.png)

3. **Verify Server Region Configuration**

- Ensure that the Firebase server region matches the configuration in FlutterFlow.
- For example, if the server region is `us-central1`, it must match in both Firebase and FlutterFlow.

In FlutterFlow:
Navigate to **Settings > Firebase > Advanced Settings** and set the correct region.

![](../assets/20250430121214190877.png)

In Firebase:
Verify that Cloud Functions are deployed to the same region.

![](../assets/20250430121214486513.png)

4. **Check FCM API Settings in Google Cloud Console**

- Open the **[Google Cloud Console](https://console.cloud.google.com/)**.
- Search for `FCM API` and ensure it is enabled.

![](../assets/20250430121214790195.png)

- Make sure that a valid server key is available in Firebase Console. If missing, create one through Google Cloud Console.

5. **Verify Cloud Permissions for flutterflow.io Service Account**

To ensure proper communication between FlutterFlow and Firebase:

- Step 1: Open Firebase Console

- Go to [Firebase Console](https://console.firebase.google.com/).
- Select your project.

- Step 2: Navigate to Users & Permissions

- Open **Project Settings** via the gear icon (⚙️).
- Select **Users & Permissions**.

![](../assets/20250430121215127010.png)

- Step 3: Verify Existing Permissions

- Locate the `firebase@flutterflow.io` service account.
- Verify the following roles are assigned:
- `Editor`
- `Cloud Functions Admin`
- `Service Account User`

![](../assets/20250430121215442199.png)

- Step 4: Add Missing Permissions

- If any roles are missing:
- Click **Add Member**.
- Enter `firebase@flutterflow.io`.
- Select missing roles from the dropdown:
- `Editor`
- `Cloud Functions Admin`
- `Service Account User`

![](../assets/20250430121215729191.png)

- Step 5: Verify All Permissions Are Applied

- Confirm that all required roles now appear next to the service account.

Following these steps should resolve most push notification delivery issues.

Loading