Push notifications are one of the most effective ways to interact with users after app installation. They allow you to notify about a new message, discount, content update, or remind about an abandoned cart. Push notifications work through cloud services: Firebase Cloud Messaging (FCM) on Android and Apple Push Notification Service (APNS) on iOS. In this article, we will explore the notification architecture, their types, and the setup process for both platforms. Learn more in the official FCM documentation.
Key Takeaways
A push notification is a message that the server sends to a mobile device without a request from the app. The message passes through a cloud service (FCM or APNS), which delivers it to the device even if the app is closed. Notifications are divided into two types: display notifications (shown to the user) and data notifications (transmit data for background processing).
The push notification architecture includes three components: (1) the app server — sends a request to FCM/APNS; (2) the cloud service — routes the notification; (3) the client app — receives and processes the notification. The server must know the device's Device Token to send a notification specifically to it. For mass mailings, Topic Subscription is used — subscribing devices to thematic channels (news, promotions, weather).
On each device, notifications are processed by the operating system: Android — via NotificationManager and NotificationChannel, iOS — via UNUserNotificationCenter. The user can configure notification behavior for each channel: allow sound, banners, display on Lock Screen, or disable completely. Proper channel configuration increases engagement and reduces unsubscribe rates.
At IT Sectr, we design the push notification system taking platform-specific features into account from the very beginning. Key decisions: choosing between FCM and direct APNS, payload format, sending frequency, and subscription mechanics. This helps avoid situations where notifications do not arrive or are blocked by the system.
Firebase Cloud Messaging (FCM) is Google's cross-platform service for delivering notifications. FCM supports Android, iOS, Web, and Flutter. On iOS, FCM works through APNS: FCM sends a request to APNS, which delivers the notification to the device. Advantages of FCM: a single API for both platforms, built-in analytics, A/B testing, topics, and audience segments.
Apple Push Notification Service (APNS) is Apple's native service. It works only on Apple devices (iOS, macOS, watchOS, tvOS). It requires direct authorization via a TLS certificate or token (JWT). APNS provides minimal delivery latency and direct integration with iOS features: PushKit, Notification Service Extension, and Critical Alerts.
The choice between FCM and APNS depends on the project architecture. If the app is iOS-only — APNS gives more control. If cross-platform — FCM is more convenient with a single API. Many projects use FCM as the primary service and additionally configure PushKit for VoIP on iOS. A hybrid approach allows getting the best from both systems.
| Characteristic | FCM | APNS |
|---|---|---|
| Platforms | Android, iOS, Web, Flutter | iOS, macOS, watchOS, tvOS |
| Authorization | Server Key (Firebase Console) | TLS certificate or JWT token |
| Max payload | 4 KB (data), 2 KB (notification) | 4 KB |
| Topics | Built-in (Topic Messaging) | No (implemented server-side) |
| Silent Push | Supported | Supported (content-available) |
| PushKit | No | Yes (VoIP, live activities) |
| Analytics | Firebase Analytics | No built-in |
| Delivery to terminated device | Limited (depends on manufacturer) | Yes, via PushKit |
A Rich Notification is a notification that contains not only text but also media content: images, videos, audio, and action buttons. On Android, it is implemented via NotificationCompat styles: BigPictureStyle (large image), BigTextStyle (collapsed/expanded text), InboxStyle (message list), MediaStyle (playback control). On iOS, Notification Content Extension is used — a separate target with a custom UI for the expanded notification.
Silent Push (content-available on iOS) is a notification delivered without displaying to the user. It is intended for background data updates: content synchronization, preloading, widget updates. On iOS, Silent Push requires enabling Background Modes → Remote notifications. On Android, FirebaseMessagingService with onMessageReceived is used for handling background notifications. Important: on iOS, Silent Push has frequency limitations and does not guarantee delivery if the app is not in the foreground.
An Interactive Notification allows the user to perform an action without opening the app. On Android, these are buttons (Action) in the notification: "Reply", "Approve", "Decline". Actions are processed via PendingIntent, which launches a BroadcastReceiver or Service. On iOS, Notification Action is registered via UNNotificationAction and UNNotificationCategory. Buttons can be foreground (opens the app), background (executes in the background), or destructive (irreversible action — delete, block).
Notification Content Extension (iOS) — a custom view controller for displaying extended notification content on long press or 3D Touch. Notification Service Extension (iOS) — middleware for modifying notification content before display: decrypting E2E messages, loading images, obfuscating confidential data. On Android, there are no direct analogs — all modifications are performed in FirebaseMessagingService.
For Android, you need to: (1) add Firebase SDK to the project (google-services.json); (2) create a NotificationChannel (Android 8+) for each notification category; (3) implement FirebaseMessagingService to receive tokens and incoming messages. Notification Channel is mandatory — without it, notifications will not be displayed on Android 8+. Channels have priority (IMPORTANCE_HIGH — sound + popup, IMPORTANCE_LOW — no sound) and are configurable by the user in system settings.
For iOS, you need to: (1) enable Push Notifications capability in Xcode; (2) configure the APNS key on the Apple Developer Portal; (3) request authorization via UNUserNotificationCenter.requestAuthorization — this is a system dialog that is shown once. The user's response is critical: if permission is not granted, notifications will not be delivered. It is recommended to explain to the user why notifications are needed before showing the system dialog (pre-permission prompt).
Device Token (iOS) and Registration Token (Android) are unique device identifiers for push notifications. The token is generated on the first app launch and may change: on reinstallation, data clearing, or privacy settings reset. The server must regularly update tokens. Firebase provides a convenient API for token management via onNewToken, as well as a panel for test notification sending (Firebase Console → Cloud Messaging).
Topic Subscription is one of the most effective FCM mechanisms. A device subscribes to a topic (e.g., "news", "promo_users_ios"), and the server sends notifications by topic without needing to store a list of tokens. Firebase Topics support up to one million subscribers per topic and conditional sending (Condition) via an expression language: "'news' in topics && ('US' in topics || 'UK' in topics)".
Notification Payload is the JSON structure sent via FCM/APNS. For FCM: separate notification (visible part — title, body, image) and data (custom fields for the app). For APNS: aps dictionary with alert, badge, sound, category, and content-available. Correct payload structure is critical: if notification + data arrive simultaneously, the app in the background may not receive the data. It is recommended to use only data messages for Android and pass visual fields separately via FCM Console.
Frequently Asked Questions
FCM (Firebase Cloud Messaging) is Google's service for Android and cross-platform notifications. APNS (Apple Push Notification Service) is Apple's service for iOS/macOS only. FCM can deliver notifications via APNS on iOS, acting as a proxy server.
A Rich Notification is an enhanced notification with media content: images, videos, audio, action buttons. On iOS, it is implemented via Notification Content Extension; on Android, via BigPictureStyle and InboxStyle.
Device Token is a unique device identifier for sending push notifications. On Android, it is the Registration Token from FCM; on iOS, the Device Token from APNS. The token may change upon app reinstallation or settings reset, so it needs to be updated on the server.
Silent Push is a notification without displaying to the user. It is used for background data updates: content synchronization, widget updates, prefetching. On iOS, it requires enabling Background Modes → Remote notifications.
PushKit is an Apple framework for delivering high-priority notifications used in VoIP apps (calls, messengers). PushKit delivers the notification even if the app is killed and guarantees app launch for processing.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.