What is a push notification?

In short
A push notification is a short message that an app or website sends to a user's device, even when the app is closed. The device shows it on the screen, like a banner or alert. Developers often send them through a service such as Firebase Cloud Messaging.
What a push notification is
A push notification is a message sent from a server to a device. The device shows it to the user as an alert, banner or badge. The app does not need to be open for this to happen. The message travels through a delivery service that runs on the phone or browser, so the app can stay quiet until something new needs attention.
The idea is simple. Your server has news for a user, such as a new email or a reply in a chat. It sends a small message to that user's device. The device then decides how to show it.
How it works
A push system has two main parts. The first is a trusted environment on your side, such as a cloud function or an app server. This part builds the message, picks who should get it, and sends it. The second part is the client app on the user's device. It receives the message through the platform's own delivery service, such as the one built into Android, iOS or the web browser.
Firebase Cloud Messaging (FCM) is one tool that handles this work. According to its documentation, it is a cross-platform messaging solution, which means one sending setup can reach Apple, Android and web apps. You can also send messages to a single device, to a group of devices, or to devices subscribed to a topic. A topic is a named channel that users can join, such as "sports-news".
There are two kinds of messages in FCM. A notification message is shown to the user by the system. A data message is passed to your app code, which then decides what to do. Data messages give you more control, while notification messages need less code.
When to use it
Push notifications work well when a user needs to know about something soon. Examples include a delivery update, a new message, a payment alert or a reminder. They can also bring people back to an app they have not opened for a while.
Use them with care. Too many alerts annoy users and make them turn notifications off. Send only messages that are useful to the person receiving them. Ask for permission before you send the first one, and explain why.
Push is also not the right tool for large amounts of data. For use cases like instant messaging, FCM can carry a payload of up to 4096 bytes. That is enough for a short message or an ID that tells the app to fetch more details. Larger content should be loaded by the app itself.
A simple example
Here is the basic flow for a chat app. A user sends a message to a friend. Your server saves it, then looks up the friend's device token. A device token is a unique ID that identifies one app installation. The server then asks FCM to deliver a short notification, such as "New message from Sam". When the friend taps it, the app opens the chat.
In practice, you set up the FCM SDK in your app first. Then you write the sending logic on your server, using the Firebase Admin SDK or the FCM server protocol. The official Get started guide walks through both steps for each platform.
Common mistakes
A frequent mistake is sending notifications to users who have not allowed them. Another is forgetting that device tokens can change, so a server should handle tokens that no longer work. Developers also sometimes put large content in the payload and hit the size limit.
It also helps to test early. The Notifications composer in the Firebase console lets you send test messages during development, so you can check how they look before writing your full sending code.
Alternatives
Push is not the only way to reach users. Email works for longer messages and does not need a device permission. In-app messages appear only while the app is open. Choose the channel that fits how urgent the news is and how much detail it needs.
FAQ
Does the app have to be open to receive a push notification?
No. The message is delivered through the device's own delivery service, so it can appear even when the app is closed. The user still needs to have allowed notifications for the app.
What is the difference between a notification message and a data message in FCM?
A notification message is displayed to the user by the system. A data message is passed to your app code, which decides what to show or do. Data messages give you more control but need more code.
How big can a push notification be?
Firebase Cloud Messaging documentation says a message can carry a payload of up to 4096 bytes to a client app. That is enough for short text or an ID, so load larger content inside the app.
Do I need a server to send push notifications?
Yes, in most cases. The sending logic runs in a trusted environment such as an app server or a cloud function, which builds the message and calls the sending service.
Sources
This page is based on the official documentation below. Read it for full detail.
Push notifications — official documentation ↗