Push notifications are messages sent from a server to a user's device, even when the Flutter app is not running. They are commonly used for alerts, reminders, and real-time updates.
In Flutter, push notifications are most often implemented using Firebase Cloud Messaging (FCM), which integrates with Android (FCM) and iOS (APNs).
Push notifications increase user engagement and allow apps to react to server-side events in real time.
They are essential for:
A Flutter app registers with a push provider (for example Firebase) and receives a device token. The backend sends a message to that token, and the operating system decides how and when it is delivered.
The behavior depends on the app state:
When the app is open, Android and iOS do not display push notifications automatically. If you want the user to see a banner or alert in the foreground, you must show it manually.
In Flutter, this is typically done by combining FCM with flutter_local_notifications to display a local notification when a message arrives in the foreground.
Push notification are useful in Flutter apps when you want to proactively engage users outside the app interface.
Push notifications are appropriate for time-sensitive information, including:
They can also help increase user retention by reminding users to return to the app after periods of inactivity.
Push notifications are also useful for events triggered by the server when the app may not be actively running.
Examples include:
Using push notifications in these scenarios allows the app to respond to server events without continuously polling the server, which helps save battery and bandwidth.
Push notification should be avoided in situations where they can negatively affect user experience or are not technically appropriate.
Push notifications should not be used for non-critical or overly frequent updates. Sending too many notifications can overwhelm users and increase the risk of app uninstalls.
For reminders or alerts that are local to the device, push notifications are not necessary.
Examples include:
In these cases, local notifications are more appropriate because they do not require server infrastructure or network access.
Push notifications are also not suitable for real-time data synchronization.
Applications that require live updates – such as chat apps or collaborative tools – should use technologies such as:
These approaches provide continuous updates without relying on push notification delivery, which may be delayed or unreliable on some devices. Overusing push notifications for real-time updates can lead to a disjointed or inconsistent user experience.
flutter_local_notifications for on-device alerts only8 min. • Dec 5, 2022
As part of a PoC for a client from the banking sector, we had to implement a business process that required some work to be performed in the background in a Flutter module. See our case and code examples of implementing background services in Flutter add-to-app.
10 min • Nov 17, 2020
Firestore and Firebase suite are great technologies. They allow developers to build some features in Flutter and other mobile frameworks really fast. However, Firestore has also many pain points that outweigh the pros in most of the more advanced cases. Is Firestore appropriate for you? Read on to find out why!
20 min. • Feb 9, 2024
In a recent project, we embarked on the exciting task of enhancing an existing app with dynamic social media elements. Choosing Stream as our ally, we navigated through challenges and came up with strategies that helped us overcome them, resulting in the successful delivery of a news feed feature. Read our complex article.