Migration to Flutter Guide
Discover our battle-tested 21-step framework for a smooth and successful migration to Flutter!
Home
Glossary

Push notifications in Flutter

What are push notifications in Flutter?

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).

Why do push notifications matter in Flutter app development?

Push notifications increase user engagement and allow apps to react to server-side events in real time.

They are essential for:

  • messaging apps
  • e-commerce platforms
  • productivity tools
  • social and collaboration apps

How do push notifications work?

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:

  • Foreground: the message is delivered to Flutter code only.
  • Background: the system displays the notification automatically.
  • Terminated: tapping the notification launches the app.

Foreground notifications (important)

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.

When to use push notifications?

Push notification are useful in Flutter apps when you want to proactively engage users outside the app interface.

User engagement and time-sensitive updates

Push notifications are appropriate for time-sensitive information, including:

  • Alerts about new messages
  • Special offers
  • System events that require immediate attention

They can also help increase user retention by reminding users to return to the app after periods of inactivity.

Asynchronous server-driven events

Push notifications are also useful for events triggered by the server when the app may not be actively running.

Examples include:

  • A delivery tracking app notifying users when shipment status changes.
  • A social app notifying users about interactions such as likes or comments.

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.

When not to use push notifications?

Push notification should be avoided in situations where they can negatively affect user experience or are not technically appropriate.

Non-critical or frequent updates

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.

Device-local reminders

For reminders or alerts that are local to the device, push notifications are not necessary.

Examples include:

  • A timer
  • A daily checklist

In these cases, local notifications are more appropriate because they do not require server infrastructure or network access.

Real-time data synchronization

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:

  • WebSockets
  • Firebase Realtime Database
  • Polling mechanisms

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.

Common mistakes when using push notifications

  • Paid Apple Developer account required (iOS): Push notifications do not work with a free Apple ID. APNs requires the $99/year Apple Developer Program.
  • No notification shown in foreground: This is expected behavior. You must display it manually using a local notification plugin.
  • Testing on iOS simulator: The iOS simulator does not support push notifications. A physical device is required.

Alternatives to push notifications

  • Without Firebase: OneSignal, AWS SNS, custom APNs + FCM setup
  • Local notifications: flutter_local_notifications for on-device alerts only

Learn more

Background services in Flutter add-to-app

Background Services in Flutter Add-to-App Case

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.

Why Firestore, Part I: Reasons to Love It

Why Firestore, Part I: Reasons to Love It

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!

Social Media Activity Feed with Stream

Implementing Social Media Activity Feed with Stream

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.