How to Use App Push Notifications
What are push notifications?
Anybody that’s used a modern mobile device is familiar with push notifications. Among other things, these versatile pop-up alerts remind us about appointments, give us previews of our conversations in chat apps, and let us know when special offers arrive from our favorite e-commerce storefronts.
What makes push notifications convenient for users, and powerful for companies, is that they don’t need a particular app to be open on a device for a message to make its way to users. Mobile users can see notifications even when their device is locked or an app is closed or in the background. Because of this, push notifications give apps the ability to reach users no matter what they’re focused on.
The real potential of push notifications is unlocked when they’re combined with real-time functionality. Together, they help users stay on top of fast-moving apps, and give marketers and developers a powerful way to continually engage and offer value to their users.
This guide will explore push notifications in-depth, covering how you can use and implement them right alongside real-time functionality. By the end of this guide, you’ll learn how push notifications and real-time interactions are a perfect complement to one another, and you’ll be able to take the first steps to implementing both in your app.
Push notification use cases
Across mobile devices (iOS and Android) and the web, push notifications give companies a flexible and familiar way to reach their users. Whether used as on-demand push alerts or in conjunction with real-time events, they give apps a direct way to convey information and prompt user action. And because they’re so flexible, push notifications have a role to play in a broad range of use cases.
How to use push notifications to reach, remind, and re-engage your users
At their core, push notifications give apps a way to reach out to users on the device level, even if the app itself is closed or in the background. This makes them perfect for things like timers and reminders, and can ensure your app is top-of-mind for otherwise busy users.
Push notifications as reminders
As timely reminders, push notifications have a unique ability to directly draw users back to your app, benefitting users and companies alike. A telemedicine app may issue push notifications to prompt patients to take medicine and log their treatment progress, helping them adhere to a treatment plan and achieve a more positive health outcome. With the same mechanism, an e-commerce app can drive customer engagement with personalized notifications. For example, they may reach out to shoppers with an abandoned cart, prompting them to return to the storefront and buy those items.
Beyond convenience, the ability to reach users wherever they are makes push notifications a powerful tool for more sophisticated user engagement and retention strategies. When used effectively, notifications can encourage users to return to an app and increase their usage.
Push notifications example: Game developers
For example, game developers often host special time-bound events like tournaments, which drive player activity with unique gameplay and rewards. Push notifications let games reach out to players far and wide when these live events start, even if they haven’t played in a while. And because users can simply tap on the notification to open the game, the notification itself serves as a vital shortcut for distractible players.
Beyond games, this strategy is equally valid for any web or mobile application that can extend time-bound offers or hold special events, be it e-commerce, live events, or social media. No matter who your audience is, push notifications let you grab their attention and direct them to take immediate action in your app, giving your marketers a unique and powerful lever to boost user engagement.
Use push notifications to extend real-time application interactions
Even when users put away your app, the world keeps moving. While screen breaks are good for our health, oftentimes the most crucial things happen when we’re away—especially when it comes to apps that connect multiple people in real time. Whether it’s a crucial work conversation, an alert from a doctor, or a surprise upset in a multiplayer game, push notifications let users stay connected to these apps, and help them conveniently return at just the right moment with mobile push notifications.
The most familiar real-time use case for push notifications is chat. Chat apps routinely push messages to members of a channel even if they’re not actively using the app, a feature that’s useful for things like user mentions, thread replies, and direct messages.
But real-time push alerts serve a broad range of use cases beyond messaging, too. In live events apps, for example, notifications let fans know the moment when games or shows begin, when crucial moments (like a touchdown) occur, or when timed special events, like audience-wide polls or special offers, are sent out.
Push notifications example: Multiplayer games
In multiplayer games, notifications can be used to ping players the moment critical events occur. They can count down to game-changing moments, alert players of a new world-wide high score, or raise the alarm when an enemy faction invades their territory.
In all of these examples, push notifications extend the liveliness of real-time activity beyond the confines of the app itself. They give users an always-on look into what’s happening, and offer them a direct path back into the app. For companies, this means gaining an increased share of your users’ attention and promoting higher in-app engagement.
Beyond supporting the core functionality for these use cases, PubNub’s platform includes a unified mobile push gateway that lets you instantly send push notifications based on real-time activity when users aren’t active within your app. This means that you can bring your users back the instant something happens, no matter where they are.
When to use web or app push notifications instead of text messages
As an additional note, it’s worth exploring the differences between push notifications and another common communication channel: text messages. Many companies use SMS-based messaging to reach users beyond specialized apps. This makes sense, because text messages are lightweight and are highly visible on mobile devices, especially because users get a notification whenever a text message arrives with no need for additional permissions.
Text messages can be great for conveying simple pieces of information, and can be useful for web-based companies and storefronts that don’t have dedicated apps. But, for those looking to reach and re-engage app users, push notifications have clear advantages over SMS:
Lower cost: Mobile users without unlimited texting plans may be charged for incoming text messages, and are likely to opt out of your communications. Meanwhile, push notifications are native to phones and come at no cost.
Control over the user experience: Both iOS and Android let users opt in and opt out of notifications, giving them the power to adjust when and how they receive alerts. This helps companies avoid annoying users with their communications, and helps ensure that those that are sent remain effective and useful.
Rich notifications: While SMS is by nature limited to plaintext, push notifications increasingly support rich content like images and icons, letting you embed relevant content directly into your alerts.
In all, push notifications serve a wide range of purposes. From simple reminders, to helping drive user engagement and retention strategies, these direct and intuitive alerts have a place in many use cases. And, because they’re flexible, native to mobile devices, and support rich content, they are the most effective way to re-engage and communicate with users outside of apps themselves.
Types of push notifications
Up to this point, we’ve been referring to push notifications collectively. In reality, while they generally look and behave the same in any context, there are important differences in the details between iOS, Android, and web push notifications that affect how you should think about and deploy them.
Mobile push notifications
Broadly, these are the most common kind of push notifications and should be familiar to almost all mobile users.
While both iOS and Android support push notifications, there are key differences in how each mobile platform treats them. When shipping an app for both popular mobile OSes, you need to make considerations for differences in permissions and visibility for different devices:
Push notification permissions:
On both iOS and Android, users have ultimate control over which apps can send notifications. On Android, users must opt out of notifications manually, while iOS apps must get users to opt in. The impact of this difference is that companies planning to release on Apple devices must come up with a strategy to convey the value of push notifications to their users in order to gain their trust and permission.
On both mobile platforms, push notifications appear on a phone’s lock screen when the device is asleep. The differences kick in once a user unlocks their device. On an iPhone, the notification itself is cleared, even though the notification messages themselves are still accessible from the notification center. On Android devices, notifications persist until a user takes deliberate action to clear or interact with the alert. For Apple developers, this adds extra incentive to make push notifications relevant and attention-grabbing, so that users opt to interact with them directly when they arrive.
Web push notifications
On the modern web, the line between traditional websites and fully-fledged web apps has been blurred, and many users accomplish many of their tasks entirely through web browsers. Luckily, modern browsers like Chrome also support their own version of push notifications that extend all the benefits of out-of-app alerts to desktop users.
As on iOS, users must first opt in to web notifications. Once they do, those notifications can appear on a desktop in a way that’s nearly identical to a mobile push notification.
As with those for mobile devices, web push notifications allow you to send customized, relevant content to web users, even if they’re not currently on your site or using your web app. This allows you to route users to content, return them to their cart, ask them to adjust a critical setting, or anything else needed for your use case.
To maximize the impact of their app, most developers will aim to launch on as many platforms as they can, but doing so effectively means managing and syncing multiple notification services. PubNub’s push notification solution reduces the complexity of supporting multiple platforms by providing a single endpoint for sending alerts. With one publish, developers can reliably send in-app alerts and trigger notifications for iOS, Android, and web.
How to implement push notifications
From a technical perspective, push notifications consist of information sent to a user’s device from a server, just like any other message. But, they are unique in that the transaction is initiated by the server, rather than by a request from the user’s device.
The notifications themselves are sent via each platform’s own operating system push notification service (OSPNS). The two major services are APNS (Apple push notification service) for iOS, and FCM, or Firebase Cloud Messaging, for Android (formerly known as Google Cloud Messaging). Each of these services provides APIs that allow apps and services to trigger notifications on their respective devices.
While developers can implement each individual service themselves, this can become cumbersome and difficult to support. Communication platforms like PubNub provide a unified push notification gateway that lets developers trigger push notifications right alongside in-app messages and alerts, and to do so across all services at once. With PubNub, subscribers to real-time channels will automatically receive notifications when outside your app, no matter what device they’re on.
How to make push notifications work in real-time
Before you can deliver notifications, you need activity to notify users about. Above, we covered numerous use cases where notifications are a product of pre-set logic or automation. In these cases, notifications are triggered when certain conditions are met, like a mobile user closing an e-commerce app before completing their purchase.
But, push notifications are most effective when used in conjunction with real-time interactions, like live chat messages, scoring in multiplayer games, or fast-moving auction prices. With notifications triggered by real-time events, you can extend the energy and activity of your app to users anywhere, keeping them informed and engaged even if they’re not focused on your app.
Here, you do need to proceed with some caution. Because of the volume of messages sent in an active app, it can be difficult to effectively sync real-time activity, in-app alerts, and push notifications. Developers often need to make considerations not to issue push alerts while users are actively in the app to avoid damaging the user experience with unnecessary notifications.
You also need to consider which activity to send as push payloads. For example, if every message in a group chat channel triggers an automated message, users may quickly opt out of push notifications entirely. In a related sense, you should decide how and whether to automatically limit app notifications based on user properties like user time zones.
Overall, manually managing real-time, in-app activity and push notifications separately can become a burden for your developers. Developing, managing, and supporting multiple services (and streams of information) can quickly become a burden on time and resources better spent elsewhere.
Rather than try to bridge in-app activity and push notifications themselves, developers should use a real-time solution that provides a unified push gateway, like PubNub. Using our gateway, you can automatically trigger notifications with custom content or with the content of any missed real-time messages. This lets users who are away keep up with active chats, receive alerts from smart devices, keep tabs on auctions, and more. Most importantly, they give users a direct path back into your app in order to act on this fast-moving information.
Setting up push notifications with PubNub
The first step is to get set up with the various notification services. To do this, developers register their app with the necessary push notification services for their target platforms. Then, they ensure that user devices that install their app also register with that service to receive notifications (this is essentially what your users are “opting in” to when they say “yes” to receiving alerts).
Then, it’s just a matter of sending the notifications, which has two parts: getting the information that will go into your notification, then sending the notification itself to the desired endpoint, whether it’s a desktop device, browser, or mobile app.
PubNub simplifies this process into a single, seamless activity, and makes it easy to automatically align your in-app and push activity. With our solutions for mobile push notifications, you don’t need to develop push notifications separately from in-app alerts or activity. Instead, our easy-to-use APIs let you automatically trigger push notifications from real-time messages for users that are offline, or have simply put your app in the background.
With PubNub, it’s easy to get push notifications up and running in your app. Our in-depth documentation walks you through each step, but we’ll summarize the simple process right here:
Enable the mobile push gateway feature for your app in the PubNub admin portal.
Register your app with APNS and FCM, and add those credentials to PubNub.
When users install your app, register that device with its respective push notification provider (ie, register iPhones with APNS, and Android phones with FCM).
Send your notifications!
PubNub lets you define the contents of your push notification right alongside your real-time messages, so you don’t have to spend additional development time just to set up alerts, and you don’t have to worry about keeping them in sync and accurate to in-app activity. Instead, with a single message, you can reach both active and out-of-app users with engaging, relevant content.
If you’re ready to start sending relevant, real-time, and precise push notifications to your users, get in touch with us. We’ll walk you through the best way to add push notifications using our platform, and will work with you to get up and running with alerts that will inform, energize, and engage your users.