What
is Push Notifications?
Push notifications update the smartphone and tablet users instantly
when an event occurred. On apple iOS devices the push notification interrupt
the user with a dialog box if he is currently using the application or it will appear
at the notification area if the app is in background, similarly in windows
store application it will be a toast where modeless
window appears with a sound. Some real world examples for push notifications
are
· Facebook app will notify
when you have a new message, friend request, comment to a post etc,
·
Gmail app will notify when
you have new email.
Basically there are two methods of
implementing push notification for mobiles. You can user ordinary PNS or you
can use notification HUB. There are lots of advantages of using notification
HUB over PNS. First I’m going to discuss about the ordinary PNS.
How Push
Notifications Work
Push notifications are delivered through
platform-specific infrastructures called Platform Notification Systems (PNS).
This is platform dependent. If developer wants to send a push notification to
iOS device he has to contact APNS (Apple Push Notification Service) to send the
notification, if that same notification is needed to send to windows app the
develop has to contact WNS (Windows Notification Service) to send the same notification
again, similarly if the developer want to send that notification to Android he
has to contact GCM (Google Cloud Message) to the message. So the developer has
to implement separate interfaces to each platform.
Drawbacks of Push Notifications.
Push notifications are the
most wanted features in the current mobile app market. But form the developer
side lot of dirty work needed to be done to send push notifications. There are
three main disadvantages of PNS.
1. Platform Dependency
As I mentioned earlier the developer must code
multiple interfaces for each platform in order to send push notifications. And
also the developer needs code high-level details such as format for each
platform. This will end up will unmanageable code.
2.
Poor Scalability
If you are using PNS the
device tokens must be refresh each and every time app is lunched to in order to
maintain the device token alive. When the no of devices increase it will incur
high traffic as well as the maintenance cost of the infrastructure.
Most of the PNS does not support broadcasting, so developer has to
send the notifications to each and every device separately, if the devices are
in millions the PNS will not be able to send the notification on time, the last
device may get the notification after 20 minutes.
3.
Routing
In most
cases the push notification is needed to send for special target groups. Then
the developer has to write coding to maintain a registry that associates groups
with the device token. Later this will become maintain overhead to the
developers.
Why Windows Azure Notification Hubs.
As a solution to upper mention problems, we can use push
notification Hub. Notification hub is like a USB hub; you can just plug any
kind of USB device (pen drive, Hard Disk, Mouse and etc) and do the work. Likewise
after registering with the HUB the developer only need to write single code to
send notification to devices in any platform. The Hub will tack care about all
the dirty work.
1.
Platform
independent
Notification HUB provide common interface to send
notifications to all major mobile platforms including Apple, Windows and
Android. Through the API provided to the HUB the developer can send platform
specific or platform independent messages.
2.
Routing
In notification HUB each devices token is
consists at least one tag. This is normally app specific identifier such as
user name, groupID and etc. This can be used to send notifications to groups
instantly. For an example from the back end we can assign the groupId as a tag to
the group member’s device token. The push notification can simply send by
mentioning the groupID as the tag. Then all the members in the group will receive
the push notification instantly.
3.
High Scalability
Notification HUB is capable of handling millions of devices without
any modification in the app back-end.