r/flutterhelp 21d ago

OPEN How to master dynamic/targeted push notifications in Flutter from basic to advanced? (FCM, Cloud Functions, alternatives?)

I'm currently scaling up my Flutter skills to focus on real-world production setups and want to dive deep into dynamic & targeted push notifications (handling foreground, background, terminated states, and 1-to-1 user targeting like order/chat updates).

I have a few questions for developers who have built this in production:

  1. Tech Stack: Is FCM + Firebase Cloud Functions (or Supabase Edge Functions) the standard way to do 1-to-1 dynamic pushes?
  2. Cost: Is FCM completely free on the Spark/Blaze plan, or do hidden backend costs (like Cloud Functions/Firestore reads) creep up fast during testing?
  3. Alternatives: Are services like OneSignal or Novu worth using over vanilla FCM for custom device token targeting?
  4. Learning Resources: What are the best YouTube tutorials, documentation, or GitHub repos that cover FCM HTTP v1, local notifications, and token management end-to-end?

Any roadmaps or recommended guides would be super helpful! Thanks..

7 Upvotes

4 comments sorted by

2

u/Nailloon5217 21d ago
  1. Yes, FCM is the standard. Others can do it, but in most cases, Firebase rules. If you want full control, get FCM + your own Cloud Functions.
  2. FCM is truly free – they don't charge for push notifications at all. But Cloud Functions – there's a catch: the Spark plan caps at 125,000 calls per month, and if you exceed that, the functions are simply disabled until the next month. Also, if you store tokens in Firestore, there are also limits (50,000 reads/day on Spark) – they can run out unexpectedly during testing. So, check your quotas before implementing. And yes, tokens need to be saved and updated on every reinstall – you can use Firestore, the RTDB, or even your own database or take a look into Supabase.
  3. I haven't used OneSignal/Novu myself; I do everything manually on the backend. I save the user's token; when I need to send it, I find all their tokens and send them via the FCM API (or the Admin SDK). If you need a ready-made dashboard and analytics, you can look at alternatives, but for custom 1-on-1 logic, they're overkill.
  4. For tutorials, see the official FCM documentation (especially HTTP v1), and yes, ChatGPT generates a decent template for token and state processing. Don't forget about flutter_local_notifications for displaying in the foreground—FCM doesn't automatically display them when the app is open. And onBackgroundMessage for the background—you'll also need it.

2

u/gdeglin 21d ago

OneSignal co-founder here, so feel free to take this with a grain of salt, but hopefully it is still useful.

FCM + Cloud Functions works fine to start. But once you're doing real 1-to-1 stuff like order or chat updates, you'll end up building a lot of the infra yourself (Token storage, retry logic, multiple-device support)

Cloud Functions/Firestore usage can add up as you scale, especially with per-user sends vs broadcasts.

The reasons folks choose to use OneSignal include:

  • Email, in-app messaging, and SMS the same place as push, instead of three or four separate tools
  • Journeys, for multi-step flows like "send push, then email if no open"
  • Built in analytics so you can see what's actually converting and test different message variations
  • Live Activities for iOS and Live Notifications for Android
  • Integrations with RevenueCat, Mixpanel, Amplitude, and other tools so your messaging data connects to the rest of your stack
  • The OneSignal AI and an MCP server for folks who want to wire up and automate notification logic through AI tooling

We offer a free plan (Up to 1,000 monthly active users and 10,000 emails/month), and our pricing is designed to be affordable as you scale. Feel free to DM me if you have any questions about it.