Push notifications enable you to send updates, alerts, and new content to mobile devices even if that mobile device is offline. However, when building a mobile push notification system for your application, unfortunately (for development's sake), there’s not one universal smartphone with a universal operating system. Users have a wide variety of devices running on a wide variety of operating systems in a wide variety of environments. As a result, developers need a more powerful way to utilize notification services across every mobile device.
In this blog post, we’ll give you a tutorial on using both APNS for iOS devices and GCM for Android, as well as how to integrate PubNub Data Streams for mobile push notifications. Each option has its own set of full documentation, so I’ll link you to the relevant documentation for each one after a brief overview. There are solid use cases for each push notification service, and we’ll go through the benefits and limitations of each as well.
We’ll cover:
Let’s get to it!
Last month, we announced that PubNub now supports GCM, enabling you to easily build GCM/Android push notifications into your PubNub application, streamlining cross platform message delivery, and eliminating the need to develop additional server-side components for GCM.
Essentially, PubNub is the provider between devices that are subscribed to your application and 3rd party sources. GCM is a great way to deliver one-way, non-critical communications with smaller payloads (128 bytes to 4KB).
Below is the documentation with full Java and JavaScript tutorials for implementing GCM. Each tutorial walks you through the architectural components, SDK methods, and how to send and receive GCM push notifications.
PubNub also makes it easy to deliver mobile push notifications to iOS devices including iPhones and iPads from your PubNub web or mobile application. Like GCM, APNS is one-way communication, but has a message size limit of 256 bytes per notification payload.
Check out the documentation with a full Objective-C tutorial for implementing APNS into your PubNub application. The tutorial includes an APNS architecture overview, how to set up an Apple and PubNub environment, and building and testing your APNS application.
If you prefer video over text, we have a eight video series on setting up APNS with Apple, then setting up APNS with PubNub.
For mission critical messaging, we encourage you to check out utilizing our PubNub Data Streams publish and subscribe APIs to implement mobile push notifications. Some of the advantages PubNub Data Streams is:
Despite the advantages of the native PubNub approach, there are cases where a developer may choose to utilize APNS and GCM, for example:
To get started with PubNub Data Streams for mobile push notifications, check out our JavaScript Mobile Push Gateway or Java Mobile Push Gateway documentation.
As you can see, there are uses cases for each push notification service. But overall, mobile push notifications are a great way to retain user engagement, keep users in the loop, and send important updates and alerts to users in real time. It really depends on the size of the message, whether you want bidirectional or one way communication, and what device you’re sending the push notification to.
There are common underlying technologies for a dating app, and in this post, we’ll talk about the major technologies and designs...
Michael Carroll
How to use geohashing, JavaScript, Google Maps API, and BART API to build a real-time public transit schedule app.
Michael Carroll
How to track and stream real-time vehicle location on a live-updating map using EON, JavaScript, and the Mapbox API.
Michael Carroll