What Are Push Notifications and Why Do They Matter?
Push notifications are a powerful tool for mobile apps, enabling one-way communication from a server to a user’s device. Whether you’re engaging users with marketing messages, sending critical updates, or simply reminding them to finish a task, push notifications offer a versatile way to interact with app users even when they aren’t actively using the app.
These notifications come in many forms, from rich multimedia marketing alerts to silent, behind-the-scenes updates. Here, we’ll break down what push notifications are, how they work, and why they’re essential to your app’s user engagement strategy.
Common Use Cases for Push Notifications
Push notifications are used widely in all sorts of apps to serve different purposes, including:
- Marketing messages: Promotions, new feature announcements, and special offers.
- Timed reminders: Reminding users of important deadlines or scheduled events.
- Flow completion notifications: Letting users know they’ve successfully completed an action within the app.
- Messaging notifications: Alerts about new messages or interactions.
These notifications are always sent on behalf of an app that the user has installed and granted permission to send notifications. On Android, users can control which types of notifications they receive based on channels set up by the app developers. While iOS doesn’t offer the same native granularity, users still have some control over notification settings.
The Structure of a Push Notification
A push notification consists of two types of data:
- Presentation Data: This is what the user sees. It typically includes a title, body text, sounds, images, and actions users can take directly from the notification.
- Custom Data: This data is handled by the app itself and may trigger behaviors like navigating to a specific screen, fetching updated data, or refreshing content. This information is customizable and can vary widely depending on the app’s needs.
Some notifications, like background notifications (iOS) or data notifications (Android), don’t present anything to the user directly but still trigger app behavior in the background.
Local vs. Remote Push Notifications: What’s the Difference?
While push notifications are typically sent from a remote server, local push notifications allow apps to trigger similar behavior directly from the device itself. Here’s a breakdown of both types:
Local Push Notifications Local notifications are triggered by the app without needing an internet connection or server interaction. The app sends a request to the device’s OS, which then displays the notification.
Advantages of Local Notifications:
- No need to call a remote server.
- No infrastructure costs or backend configuration.
- They work offline.
Limitations:
- The app must be in the foreground to trigger the notification.
- They can’t re-engage users who haven’t opened the app in a while.
- Since the logic is embedded in the app’s code, changes require an app update.
- No traceability—there’s no backend server to track whether notifications were sent or delivered.
Learn more about improving the look of the incoming notifications in our article on Improved Conditional Styling in React Native.
How Do Remote Push Notifications Work?
Remote notifications are triggered by a server and sent to the user’s device via a push notification provider like Firebase Cloud Messaging (FCM) for Android or Apple Push Notification Service (APNS) for iOS. Here’s a step-by-step overview of how they work:
1. User Grants Permission
Before sending notifications, the app must ask the user for permission via a native popup. If the user denies this request, the app cannot ask again, and the user would need to enable notifications manually in their device settings.
2. Device Registers with a Push Notification Provider
If the user grants permission, the app registers the device with a push notification provider (FCM for Android, APNS for iOS). The device is then assigned a unique device token, which is linked to the app installation on that device, which means that if a user reinstalls the app, that token will change.
3. Device Sends Token to Backend
The app sends the device token to its backend server, which stores the token for future notifications. It’s important to also store the device’s OS information, as different systems require different providers (APNS for iOS, FCM for Android).
The backend should also provide a way to unregister a device from a user so that a device is not sent notifications when they shouldn’t.
4. Backend Stores Token
The backend must store these tokens securely, as they could be misused to send unauthorized notifications. For apps that send user-specific notifications, the backend should be able to associate tokens with specific users, recognizing that users may have multiple devices or, conversely, that multiple users could share a single device.
5. Backend Requests Push Notification
When the backend decides to send app users Push Notifications, it must send it to the correct Push Notifications Provider.
Each Push Notification Provider has a general shape in which it requires the Push Notification information to be sent, and they also might not support the same features, so if you are planning to send the same to multiple OS’s, you should design them accordingly.
Also, take into consideration the localization of the messages for Push Notifications that must be presented to the user.
For this, one could take the approach of storing the user’s language and sending the messages accordingly from the backend.
The other option (more intended for native apps and less flexible) is to send keys instead of texts and using those keys to select the message from a dictionary.
6. Provider Sends Notification to Device
The Push Notification Provider will try to send the data to the device as soon as it can, but it claims to be a best effort system and does not guarantee the arrival of the messages nor its timing. In general, one can expect these messages to reach the user’s device in a matter of seconds, but there are some situations in which this may not be the case:
- The user’s device is offline: In which case the provider will store the message for a period of time (which can be configured but will never go over a month on Android or iOS)
- The provider is experiencing some kind of delay: In which case the messages will, at best take longer and at worst be discarded
- The user device token becomes invalid: For example, if the user revokes permissions or uninstalls the app, and in which case the message will never make it to the user.
7. Notification Reaches Device
Once the notification arrives, its behavior depends on the app’s state (foreground, background, or terminated), the notification payload, and the user’s device settings. If the app is in the foreground, it handles the notification directly; otherwise, the OS manages its presentation.
Check out our guide on Best Practices in Product Discovery to learn more about designing effective user interactions.
Considerations for Using Push Notifications
While push notifications can greatly enhance your app’s functionality, it’s important to keep the following best practices in mind:
On Safety
Never include sensitive user information in push notifications. Push notifications are not secure and can be intercepted. Instead, use them to signal the app to fetch sensitive data in the background.
On Reliability
Push notifications are a best-effort service, meaning delivery is not guaranteed. Developers should avoid designing critical workflows that rely on the successful delivery of a push notification. Additionally, users can revoke notification permissions at any time, which could disrupt app functionality if push notifications are required.
Final Thoughts
Push notifications are a versatile tool for improving app engagement and user experience. Whether you choose to implement local notifications for offline functionality or rely on remote notifications to reach users even when they’re not actively using your app, it’s essential to understand both their advantages and limitations. By carefully designing and implementing your push notification strategy, you can improve user retention and interaction without compromising security or user trust.
For more insights into mobile app development and design strategies, check out our article on How to Build a Long-Term Software Development Partnership or learn more about our services at OrangeLoops Products.