How to handle all kind of notifications in Flutter
summary
Practical guide for notifications using Firebase Cloud Messaging: use FCM for server pushes, Firebase Functions + Admin SDK to send messages, and prefer flutter_local_notifications to render data‑only messages locally so the app computes content and uses stable notification IDs and thread/group keys. Background handlers require the @pragma("vm:entry-point") decorator and reinitializing Firebase; use a Riverpod ProviderContainer to access services off the widget tree, handle iOS time limits (<5s), request runtime permissions (Android 13, web, iOS), and test platform‑specific behaviors.
AI-written summary · about
chapters (16)
- 0:00Introduction and motivation
- 1:08Types of notifications
- 3:13Device vs server notifications
- 4:58Setting up FCM
- 7:06Requesting notification permissions
- 8:33Foreground and background notifications
- 10:47Handling background messages
- 12:12Sending notifications from server
- 14:00Data-only notifications
- 15:45Testing notifications
- 16:48Handling data-only notifications
- 17:09Binding notifications to GoRouter
- 18:13Handling killed app state
- 19:37Using Flutter Local Notifications
- 22:46Debugging notifications on iOS
- 23:51Conclusion and Q&A








