The Mobile Spoon - Gil Bouhnick's Mobility Blog
Home My Favorites iOS Apps Talk To Me About

Oct 7, 2011

How Do Push Notifications Work? The Non-Technical Guide

push notification in iPhone

Before reading this article, it is recommended to start by understanding the Direct Push technology:

How does 'Direct Push' work?

Today I would like to write about Push Notifications. You all heard the term, but how exactly does it work? How do those notifications are managed by iOS or Windows Phone 7?

A workaround to a real multi-tasking

Usually, a push is done by having an application running in the background, pulling information, or listening to specific events that are pushed from a server.

This is not the case with iOS and Windows Phone 7 which are both lacking a true multi-tasking mechanism – by design, in order to save battery life and improve performance.

Since no application can run in the background and raise its' own alerts, iOS and WP7 include a different approach for providing the functionality of waking up the device, and present a notification/popup message/badge/information label, etc.

How exactly does it work

No server in the world can send notifications to an iOS or a WP7 device. The only servers that can do that are the Apple Push Notification Server (known as APN) for iOS devices and and the Microsoft Push Notifications Server (MPN) for WP7 devices.

In other words, if your app needs to get a notification when a certain even happened, it needs to "ask" to receive this notification from Apple or Microsoft.

how do push notifications work 

Typically, you will have to set up a server side application that will register to the push notifications service, (of course it requires SSL certification, registration, etc. in order to keep this entire mechanism safe). Once a notification needs to be sent – your application server will have to notify the push notification service (this one is Apple's and Microsoft's global services), by sending the message type, body, and other pre-defined parameters. Only those services will be responsible of sending the notification to the proper device.

The device, on the other hand, which is running Apple's iOS or Windows Phone 7 OS, provides some API's for the different apps to "do something" whenever a notification is sent to them. This "handlers" can be activated even if the application is not running (usually it's part of the app configuration settings, and can be turned off if you wish to cancel it). When a push notification message is sent to application 'A', then the operating system receives that message, calls a particular function inside application 'A' in which application 'A' can do whatever it wants: show a message, mark a number inside the badge, etc. Usually, since the push notification message is small, the app (in our example: application 'A') will create a secondary call, this time to its' own application server, to retrieve more information.

From the developer's point of view, if he wants to have push notifications capability in his app, he must have a server with some logic and capability to send a message to the push notification services. He also need to implement a few additional functions in his client side app, that will "do something" whenever a notification is received.

Apple and Microsoft, on the other hand, will take care of the actual "push" of those notifications, and will remember to "wake up" his little app, once those notifications were received in the device. This design is considered to be safer and save battery life, by reducing all the multi-tasks usually required to implement push.

how do push notification work for iOS and WP7

Both push notifications services (Apple's and Microsoft's)  are using a persistent IP connection for implementing their push notifications functionality. It is a similar approach to the Direct Push algorithm, only in this case, the push notification server gets the information (and the trigger) when and what to push from many different sources – the server side applications…

Read more about how push notifications work in here:



17 comments:

Metformin said...

Thanks for this information

Longboat Key homes said...

Interesting. I never knew that the notificatoin has to pass through a lot of layers before reaching to my handset. Thanks for sharing.

How to Get Abs in a Week said...

This is a great write up since I literally just spoke to my developer and he explained how difficult push notifications can be for iPhone apps. So now I'm thinking about scrapping the idea entirely even though your article helped break down what's involved. Thanks a lot for making this available!

Anonymous said...

very god post...
and your page is very nice...
website marketing companies | seo services company

The Mobile Worker said...

Nice post. I used to be checking continuously this blog and I am inspired! Very useful information.I used to be seeking this particular info for a long time. Thank you and good luck.

chnlove scam said...

Nice to be here and see your post!

Share Tips said...

Hey - nice blog, just looking around some blogs, seems a pretty nice platform you are using. I'm currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

Best Stock Analysis said...

Always good to see, this was really a brilliant post. In theory would like to be such a good writer too. It takes time to creat that brilliant and additionally real effort to make a brilliant article.

stock market tips said...

Thank you for posting the great content…I was looking for something like this…I found it quiet interesting, hopefully you will keep posting such blogs….Keep sharing

stock market tips said...

First of all let me tell you, you have got a great blog .I am interested in looking for more of such topics and would like to have further information. Hope to see the next blog soon. stock market tips

commodity tips said...

Nice Information! I personally really appreciate your article. This is a great website. I will make sure that I stop back again!. Commodity Tips

commodity tips said...

I always like your blog post because you always comes with different ideas and information. I always shared your site post with my friends. Keep posting and i will follow you. Commodity Tips

intraday tips said...

Very nice and helpful information has been given in this article. I like the way you explain the things. Keep posting. Thanks.. intraday tips

intraday tips said...

It is a well executed post. I like the diagram most. It is a helpful informative post. Thanks for sharing this great information. intraday tips

Sock tips said...

It is a well executed post. I like the diagram most. It is a helpful informative post. Thanks for sharing this great information. Stock tips

Tobias Diestelkamp said...

Thanks for the great explanation!
One question: can a push be sent to a dedicated user, while the app is sleeping and I use another appp in the foeground? Like: I have a mail app, and my server knows there is a new message and sends a push to ONLY THIS ONE user, only to his dedicated device? Or does this require, that the sleeping app wakes up regularly checks for new mail?

Thanks truly!

Vaishali Delawala said...

Push notification is very logical tool to reengage users, it is really superior to connect with your site visitors and hope fully helpful to deliver impressive outcomes. Email subscriber helps to repeat traffic for your website through email marketing, push notification uses to same thing to generate more traffic.

Post a Comment