What is a Push Notification?

A push notification meaning or a push message is an asynchronous message typically sent from a server to a device instructing the device to perform some action.

A push message results in a notification being displayed on mobile devices even if the device is on standby, informing the users that new data is available. A very common use case for push notifications is chat: The messaging server will send a new chat message to the device, and if the user has the chat app open, the message will appear in the conversation. If the chat app is in the background, the device will show the user a notification instead. Device Notifications are strongly linked with push use cases since they allow applications to perform work in the background.

Push notifications are not limited to mobile devices. For example, browser based calendar and mail apps will send a notification to your browser to alert you that a new event or message is available.

What is a Push Notification with PubNub?

The PubNub API will receive messages for any subscribed channel, but this is only possible if the application that needs to receive the message is running. As previously mentioned, mobile devices will restrict what an application can do in the background, so if the user is not interacting with your app when a PubNub message is received, you have two choices:

  1. Use the message history feature to fetch ‘missed’ messages when the application returns to the foreground. This choice is less than ideal if the user needs to be alerted immediately when a message is received, for example, a chat message.

  2. Use the mobile device’s push notification mechanism (either Apple’s APNS or Google’s FCM, depending on the device) to immediately inform the user that a new message is available, even if the app is not running.

The diagram below shows how PubNub messages are delivered as the payload of the mobile device’s native push messaging technology (APNS / FCM), ensuring messages are received on the device even if it is on standby.

push-runtime.png

Push messaging and notifications are complex topics that can vary by platform. Please refer to Apple’s APNS or Google’s FCM for more information. 

MORE FROM PUBNUB
Push Notifications Made Easy

Push Notifications Made Easy

PubNub makes it easy to deliver APNS and/or GCM push notifications.
Sending Android Mobile Push Notifications with FCM and PubNub

Sending Android Mobile Push Notifications with FCM and PubNub

How to implement mobile push notifications in your Android app using Firebase Cloud Messaging (FCM) and PubNub.