Docs

FlutterFlow push notifications with PushFire

Integrations

This guide shows how to set up FlutterFlow push notifications with PushFire-Lib, the PushFire library for FlutterFlow. The library packages the PushFire Flutter SDK as ready-made custom actions, so you register devices, identify subscribers and tag users without writing Dart. PushFire is the easiest lifecycle messaging platform for AI agents and vibe coders: push and email lifecycle campaigns, segments and workflows behind one small API.

Prerequisites

  • A PushFire account and project. Create one at console.pushfire.app.
  • Firebase credentials uploaded to the PushFire project. See Create your first project.
  • A Public key (pf_pk_...) from Developers → API keys. It is safe to ship in an app. See Public and Secret keys.
  • A FlutterFlow project with Firebase connected and push notifications set up for iOS (APNs key in Firebase) and Android.
  • PushFire-Lib acquired from the FlutterFlow marketplace.

Install PushFire-Lib

  1. In FlutterFlow, open Settings & Integrations.
  2. Go to Project Setup → Project Dependencies → FlutterFlow Libraries.
  3. Search for PushFire-Lib and click Add to Project.

If the pushfireApiKey and provider fields do not appear after you add the library, switch the library version to an earlier one, open its details, then switch back to the latest version. The fields then show.

Initialize: API key, auth provider and SDK package

  1. In Project Dependencies, set the library value pushfireApiKey to your Public key.
  2. Set provider to the auth system your app uses: Firebase, Supabase, or none. With Firebase or Supabase, PushFire logs subscribers in and out automatically when users sign in and out.
  3. Go to Project Setup → Pubspec Dependencies. Under Custom Pub Dependencies, click + Add Dependency, enter pushfire_sdk as the package name and ^0.3.4 as the version.
  4. Open App Settings → Custom Code → Configuration Files → Flutter → main.dart. Under Initial Actions, add the custom action pushfireInitialize. It takes no parameters and reads the API key you set in step 1.

On first launch, pushfireInitialize asks for the notification permission and registers the device with PushFire.

Register the device and identify the subscriber

Device registration happens inside pushfireInitialize. Each device starts with an anonymous subscriber.

  • Provider Firebase or Supabase: no action needed. On sign-in PushFire logs the subscriber in with the user's ID as externalId, plus email, name and phone. On sign-out it logs the subscriber out.
  • Provider none: call the pushfireLoginSubscriber action after your sign-in action, and check its parameters in the action editor.

Keep the profile current with these actions:

  • pushfireUpdateSubscriber: parameters name, email (optional) and phone (optional). Call it after a user saves profile changes.
  • pushfireLogoutSubscriber: no parameters. Call it in your logout flow next to your auth sign-out.

Add, update and remove tags

Tags feed segments and workflow conditions. Create the tag in Audience → Tags in the PushFire console and copy its ID from the tag page. The actions need the tag ID, not the tag name.

  • pushfireAddTag: tagId and tagValue. Example: set the plan tag to trial after sign-up.
  • pushfireUpdateTag: tagId and the new tagValue. Example: set the plan tag to pro after an upgrade.
  • pushfireRemoveTag: tagId. Example: remove an onboarding tag when the tour ends.

Trigger a workflow

Start workflows from a server function, for example a Firebase Cloud Function or a Supabase edge function. FlutterFlow calls it with an API call or a backend call, and the function starts the workflow through the REST API with a Secret key. See Send push notifications from Node.js for the function code.

Warning: never ship pf_sk_ in a mobile app, browser bundle or no-code frontend. PushFire does not block a Secret key on a client, and anyone can extract it from your app and message all your users. Start workflows and send messages from your server, a Supabase edge function or a Firebase Cloud Function.

The pushfireExecuteWorkflow action takes a workflowId and runs that workflow for the current subscriber. It is secret key only, not for production apps: with the Public key in your library value, the API answers 403 Client key cannot perform this action.

You can also start journeys with no call: set a tag in the app, and a segment built on that tag starts the workflow in PushFire.

Send push and email from your server

To send a one-off push or email to specific users, call the REST API from a server with a Secret key. Target the externalId values the app logged in.

Warning: never ship pf_sk_ in a mobile app, browser bundle or no-code frontend. PushFire does not block a Secret key on a client, and anyone can extract it from your app and message all your users. Start workflows and send messages from your server, a Supabase edge function or a Firebase Cloud Function.

For campaigns without code, use Broadcast in the console.

Verify delivery

  1. Run the app on a real device. Push does not work in the FlutterFlow web preview.
  2. Sign in, then open Audience → Subscribers in the PushFire console. Confirm the subscriber, the device and any tags.
  3. Send a test with the curl call above or a broadcast, and check the status under Developers → API Messages → Push Notifications or in the broadcast history.

Troubleshooting

  • Library fields missing: switch the PushFire-Lib version and back, as described in the install step.
  • Build fails on pushfire_sdk: check the pubspec dependency is pushfire_sdk with version ^0.3.4.
  • No subscriber after sign-in: check that provider matches your auth system, or call pushfireLoginSubscriber when it is none.
  • Tag action fails: pass the tag ID copied from the console, not the tag name, and make sure a user is signed in.
  • pushfireExecuteWorkflow fails with 403: expected with a Public key. Start the workflow from a server function or with a tag and segment.
  • No notification on iOS: upload the APNs key to Firebase and test on a physical iPhone.

FAQ

Can I add push notifications to FlutterFlow without code?

Yes. PushFire-Lib gives you custom actions for initialization, subscribers and tags, which you add in the action editor. Workflows and broadcasts are built visually in the PushFire console. You only need code, or a backend call, to send targeted push or start workflows from your own server.

Which version of pushfire_sdk should FlutterFlow use?

Use ^0.3.4, the current release on pub.dev. Older guides mention ^0.1.3. The library actions call the SDK, so the pubspec dependency must be present. If FlutterFlow reports a version conflict with its own Firebase packages, check the PushFire-Lib release notes for the supported range.

Does PushFire work with Supabase Auth in FlutterFlow?

Yes. Set the library's provider value to Supabase. PushFire then listens to Supabase auth events and logs the subscriber in with the Supabase user ID on sign-in and logs out on sign-out. Push delivery still uses Firebase Cloud Messaging, so Firebase must be connected too.

Is it safe to put the PushFire API key in FlutterFlow?

Yes, if it is the Public key (pf_pk_). A Public key can only register devices, manage subscribers and set tags. It cannot send messages or start workflows, and you can rotate it in Developers → API keys. Never paste a Secret key (pf_sk_) into a FlutterFlow library value.

Next steps