How Push Notifications Work on Phones and PCs
Push notifications flow through platform brokers such as APNs and FCM.
Push notifications work because the operating system, not every app, maintains a trusted path for receiving messages from the outside world. If every app kept its own long-lived network connection, phones would waste battery and background activity would become chaotic. Instead, Apple, Google, Microsoft, and similar platform vendors run central push services that act as brokers.
On Android the common broker is Firebase Cloud Messaging (FCM). On Apple devices it is APNs. Windows has its own push service as well. The exact APIs differ, but the flow is broadly similar.
1. The app registers with the platform
When the app is first installed or first launched, it asks the operating system for permission to receive push notifications. The OS talks to the platform push service and returns a device token or registration token for that specific app instance on that specific device.
That token is not a user account. It is more like a routable address for one app on one device. If the app is reinstalled, the token may change. If the user disables notifications, the platform may stop delivering them.
2. The app server stores the token
The client app sends that token to the developer's backend. The backend stores it together with the user ID, device type, app version, and often a last-seen timestamp. This matters because tokens go stale. Devices are replaced, apps are uninstalled, and push providers eventually reject old or invalid tokens.
3. The backend sends a message to the push provider
When something important happens, such as a new chat message or a bank transaction alert, the backend does not open a direct connection to the phone. It sends a request to FCM, APNs, or the relevant provider using server credentials. The request contains the target token, a payload, and optional delivery hints such as priority, expiry time, or collapse identifiers.
A collapse identifier tells the provider that several older notifications can be replaced by a newer one. That is useful for things like "package status updated" where only the latest state matters.
4. The provider queues and routes the notification
If the device is offline, the provider may queue the message for a while, subject to time-to-live rules. If the device is online, the provider sends it over the OS-managed channel. The operating system then decides what happens next.
Sometimes the OS displays a visible notification immediately. Sometimes it wakes the app briefly to process a data-only message. Sometimes it defers or drops delivery because of battery rules, network conditions, notification permissions, focus modes, or anti-abuse limits.
5. The app or OS presents the result
A visible push usually contains title, body, icon, and action metadata. A silent or background push may update local data so the app opens with fresh content. Either way, delivery is best-effort, not a hard real-time guarantee.
Practical constraints people forget
Push systems are designed for efficiency and user control. That means several limitations are normal:
- delivery can be delayed
- devices offline for too long may miss old messages
- users can mute, group, or block notifications
- providers rate-limit abusive senders
- tokens must be rotated and cleaned up
So the key idea is simple: your server usually talks to a platform push broker, and the broker talks to the device through an OS-controlled channel. That design saves battery, improves security, and lets the platform enforce user preferences, but it also means push delivery is never completely under the app developer's control.