GUIDE

How to Use App Push Notifications

guides-push-notifications-800x348.png

What are push notifications?

Most users of modern mobile devices are familiar with push notifications, which alert us about appointments, chat messages, and special offers from e-commerce sites.

What makes push notifications powerful is their ability to reach users without requiring a specific app to be open. Users can see notifications even when their device is locked or an app is in the background, allowing continuous engagement.

The true potential of push notifications is realized when combined with real-time functionality, helping users stay updated and enabling marketers to engage effectively.

This guide will delve into push notifications, detailing how to implement them alongside real-time features. By the end, you'll understand how these elements complement each other and how to get started in your app.

pushNotifications.png

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

Push notifications uniquely draw users back to your app, benefiting both users and companies. A telemedicine app can remind patients to take medication and log progress, improving health outcomes. Similarly, an e-commerce app can engage shoppers with personalized alerts about abandoned carts, encouraging purchases. This ability to reach users anytime makes push notifications a powerful tool for enhancing engagement and retention strategies, driving users to return and increase app 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 aren’t actively using your app, important events can occur. Push notifications keep them connected to real-time activities, whether it's a work conversation, a doctor’s alert, or a gaming upset. Chat apps are a prime example, pushing messages for mentions and replies even when users are inactive. Beyond messaging, push alerts enhance live events by notifying fans when games start, crucial moments happen, or special offers are available.

Push notifications example: Multiplayer games

In multiplayer games, push notifications alert players to critical events like countdowns, high scores, or enemy invasions. They extend real-time activity beyond the app, keeping players engaged and offering a direct path back into the game. PubNub’s unified push gateway lets you instantly send these notifications based on real-time events, ensuring users return the moment something important happens. 

When to use web or app push notifications instead of SMS text messages

Push notifications differ from SMS, a common communication method for businesses. SMS is simple and highly visible, but push notifications offer clear advantages: they’re cost-free, customizable, and allow rich content like images, unlike SMS, which is limited to plaintext. Push notifications are ideal for re-engaging app users, offering better control over the user experience and driving engagement and retention.

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. 

Push Visibility:

On mobile devices, push notifications show up on the lock screen when the phone is asleep. On iPhones, notifications disappear after unlocking but remain in the notification center, while on Android, they stay until the user interacts with or clears them. For Apple developers, this means push notifications must be engaging and relevant to prompt immediate interaction.

Web push notifications

Modern browsers like Chrome support web push notifications, letting you send customized alerts to users even when they're off your site or app. Users must opt-in first, but once enabled, these notifications work just like mobile push alerts, allowing you to engage users with relevant content, guide them back to your app, or prompt important actions.

Smartphone screen with a cryptocurrency price alert notification for ChainCoin with a colorful abstract background.

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

To deliver notifications, you first need user activity to notify about. Notifications can be triggered by pre-set logic, such as a user abandoning their cart in an e-commerce app.

Push notifications are most effective when paired with real-time interactions, like live chat, multiplayer game scores, or auction prices. This keeps users engaged even when they aren’t focused on your app.

However, syncing real-time activity, in-app alerts, and push notifications can be challenging. Developers must avoid sending unnecessary push alerts while users are active in the app to maintain a good experience.

Careful consideration is also needed for what triggers push notifications. For instance, too many notifications from a group chat can lead users to opt out entirely. Limiting notifications based on user properties, like time zones, is also important.

Managing real-time activity and push notifications separately can be burdensome for developers. Instead, using a unified push gateway, like PubNub, allows for automatic notifications triggered by missed messages. This keeps users connected and provides a direct path back to your app.

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 push documentation walks you through each step, but we’ll summarize the simple process right here:

  1. Enable the mobile push gateway feature for your app in the PubNub admin portal. 

  2. Register your app with APNS and FCM, and add those credentials to PubNub.

  3. When users install your app, register that device with its respective push notification provider (ie, register iPhones with APNS, and Android phones with FCM). 

  4. 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.