Over a million developers have joined DZone.

I Want My Push Notifications!

This article looks at a couple of different ways that you can incorporate push notifications into your mobile app development for clients who see it as a "must have."

· Mobile Zone

Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.

When gathering requirements, I am often asked to architect applications that have a mobile component that revolve around push notifications. For many clients, push notifications are a "must have"—they absolutely cannot live without them. They see so many other mobile applications that seemingly also revolve around push notifications.

While push notifications are extremely handy and can add some serious value to your mobile application, there is an aspect to them that most people either don't know or overlook:

Push notification delivery is not guaranteed! It is made on a "best efforts" basis.

A quick look at iOS/APNS and Google/GCM documentation shows this to be true. The APNS documentation puts it best by saying that push notifications are "not intended to deliver data to your app, only to notify the user that there is new data available."

Mission Critical

So what do you do when your client has mission-critical requirements that require the use of push notifications?

First off, you can reassure your client that push notifications most certainly can be integrated with their solution; however, it needs to be supplemented by other systems if a guarantee is needed.

Traditionally, if a client (mobile or otherwise) has needed to receive new data from a server, one of two ways has been utilized:

  1. Polling
  2. Event-based notification (i.e. with pre-registration)

The first option is one I am certain most of us are very familiar with; however, it can be a battery killer in the case of a mobile device and can also chew through data plans like a beaver through a log. That said, it is often the easiest to implement, so if cost of development is a big concern, don't dismiss this option out of hand.

The second option is clearly closer to the push notification option. How else can this be achieved?

Server Push

In the past several years, technologies such as COMET/HTTP Long Polling and HTTP Push (e.g. WebSockets) have made such client/server data exchanges more accessible. More libraries are coming out to make things easier on the server side.

Perhaps my favorite such library (and likely most popular) is socket.io for Node.js. It makes event notifications very easy to achieve. And it goes beyond just simple "push notifications". For example, socket.io is the cornerstone to several online messaging/chat applications.

But while socket.io may seem like somewhat of a panacea, some care must be taken to ensure your application remains scalable. This can add development cost that your prospective client may or may not want to bear, so be sure to take this into account.


Messaging and push notifications are a mainstay of mobile application development. It's such a mainstay that many people think that mission critical functionality can be built around this technology. With a little patience, these clients can be educated and informed of the options that are available in order to properly ensure and better guarantee the delivery of their messages and new data.

The Mobile Zone is brought to you in partnership with Strongloop and IBM.  Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud.

mobile,push notifications,polling

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}