OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Push notifications with Firebase: notification messages vs data messages

Compare Firebase notification and data messages, their handling responsibilities and the limits to consider when designing push behavior.

OOmnistu
Reviewed 2026-11-16 · 2 min read

If your app uses Firebase Cloud Messaging (FCM), the first design choice is which of two message types to send. Firebase's documentation (https://firebase.google.com/docs/cloud-messaging/concept-options) explains the difference. This article covers FCM only; iOS and Android system rules for permissions and display have separate documentation.

The two message types

A notification message can also carry an optional data payload. Then FCM displays the notification and your app handles the data.

Maximum payload for both types is 4096 bytes, except messages sent from the Firebase console, which has a 1000-character limit.

Which should you use?

Firebase's guidance: use notification messages when you want the SDK to display the notification for you while the app is in the background. Use data messages when you want to handle the message in your own client code.

Need Starting point (our reading of the above)
Simple alert, such as "Your order has shipped" Notification message
Silent update of in-app data Data message, subject to platform background execution and delivery limits, never a guaranteed immediate job
Alert that also opens a specific screen Notification message with a data payload
Custom display logic in the app Data message

Where to send from

The documentation says to use the Admin SDK or the HTTP v1 API from a trusted environment such as Cloud Functions or your app server. The Firebase console is suited to testing and to marketing or re-engagement messages, and offers analytics-based A/B testing.

Practical design rules (Omnistu advice, not from the source)

  1. Send notifications that are timely and useful to that person, such as an order status change. Keep marketing sends separate and optional.
  2. Ask for notification permission when the benefit is clear, not on first launch.
  3. Give users a setting to choose which kinds they receive.
  4. Test the three states: app in foreground, background and closed.
  5. Never put sensitive data in the notification text, since it may show on a lock screen.
  6. Keep payloads small; the limit above is 4096 bytes.

Limits

We did not read FCM's platform-specific pages for iOS and Android, so behaviours such as delivery timing and permission prompts are not covered here.

By Omnistu.

Sources

Previous
Reading a PostgreSQL query plan: EXPLAIN without the guesswork