Mobile Apps

How Push Notifications Work

How a server reaches your phone with an alert even when an app is closed, the role of the platform notification services, and how to manage what you receive.

On this page
  1. The problem push solves
  2. The cast of characters
  3. Step by step
  4. Why it works when the app is closed
  5. Notification messages and data messages
  6. Why alerts are sometimes late or missing
  7. Privacy considerations
  8. Managing what you receive

The problem push solves

Imagine you want a message from a chat app to reach you the moment it is sent. One approach would be for the app to keep a connection open to its server all day, or to ask “anything new?” every few seconds. With dozens of apps doing this, your battery would drain quickly and your data would be wasted. Push notifications solve this by sharing one connection among all apps and letting servers send a message to the phone only when there is something to say.

The cast of characters

Several parties are involved, and understanding them explains most of the behavior you see.

  • Your app, installed on the phone.
  • The app’s server, run by the developer, which decides when an alert should be sent.
  • The platform’s push service, operated by the company behind your phone’s operating system. Each major platform has one, and apps on Android and iOS use different ones. Some Android phones use additional services from the manufacturer.
  • The operating system on your phone, which maintains the connection to its push service and displays the alert.

The key point is that the developer’s server does not talk to your phone directly. It hands the message to the platform’s service, which knows how to reach the device.

Step by step

1. Permission. On many systems, an app must ask your permission before showing notifications. On others, they may be allowed by default until you turn them off. Either way, you stay in control through the settings.

2. Registration. When the app starts, it asks the operating system to register for push. The system contacts the platform’s push service and receives back a unique identifier, usually called a device token or registration token. The app sends this token to its own server, which stores it alongside your account.

3. An event happens. A friend sends you a message, a delivery is nearing, or a news site publishes a story. The developer’s server decides that you should be told.

4. The server sends a request. It composes a small message containing the token, the text to display and perhaps a little data, and submits it to the platform’s push service over a secure connection.

5. The platform delivers it. Your phone already has a long-lived, efficient connection to the platform service, shared by every app. The service forwards the message down that connection.

6. The phone shows the alert. The operating system receives the message, wakes the relevant part of the app if needed, and displays the notification: a banner, a sound, a badge on the icon. If the phone is off or has no connection, the service may hold the message for a while and try again later, but this is not guaranteed forever.

Why it works when the app is closed

Because the long-lived connection belongs to the operating system rather than to each individual app, the app does not need to be running. This is also why push is gentle on the battery. It fits with how phones manage apps in the background: apps are frozen to save resources, yet the system can still wake one briefly when a message arrives.

Notification messages and data messages

Developers often use two broad kinds of push message.

  • A display message contains text that the system shows directly.
  • A silent or data message carries information for the app instead of for you. It may prompt the app to refresh content in the background, so that fresh information is ready when you open it.

Platforms limit how often silent messages can wake an app, because abuse would drain the battery.

Why alerts are sometimes late or missing

Push is described as “best effort” by design. Common reasons for problems include:

  • Poor or no connectivity, so the message waits.
  • Battery saver modes, which can delay or restrict background delivery.
  • Restrictive manufacturer settings, which may stop apps from waking the phone.
  • Disabled notifications, either for the app, a specific category, or through a focus or do-not-disturb mode.
  • Expired or changed tokens, for example after reinstalling an app or restoring a phone.
  • Server-side problems at the developer or at the platform.

If a particular app’s alerts seem unreliable, checking its notification settings and any battery restrictions is a sensible first step.

Privacy considerations

Because messages pass through the platform’s service, developers are generally advised not to place sensitive details in the notification payload, and many apps send only a short prompt that the app then resolves after you open it. What shows on a locked screen is something you can control. Most phones let you hide the content of notifications until the device is unlocked, which can be worthwhile for messages, email and banking apps.

Notifications can also be misused. Scammers sometimes send fake alerts or create websites that ask you to allow notifications and then fill your phone with unwanted messages. Only allow them for sites and apps you trust, and be wary of alerts that urge you to act urgently, since these are a common sign of online scams.

Managing what you receive

Good notification hygiene can make a phone calmer.

  • Turn off alerts for apps that do not need them.
  • Use categories where available, keeping direct messages but muting promotions.
  • Schedule quiet hours or focus modes.
  • Review settings after installing a new app, since defaults can be noisy.

Push notifications are, in the end, a delivery system. Whether they are helpful or annoying depends mostly on how the developer uses them and on the choices you make in settings.

The complete guide to mobile apps

How Mobile Apps Are Built
Read the guide

Keep exploring

Guides from other topics

All topics →