Mobile Push Notifications

Push notifications have been around for only five and a half years, but today, it’s hard to imagine smartphones without them.  Push notifications seem simple–just alerts you get when an app has new information for you, right?  Ostensibly, yes.  But they’re so much cooler than that, and there’s a lot going on behind the scenes.

I work on the backend for LunchBunch, so most push notifications originate from the servers on my end of the application.  Information that needs to be sent to individual devices is delivered using a combination of Amazon, Apple, and Google servers before being displayed to the user.  The alert message that the user sees is usually only a small part of the payload; bundled with the alert can be all kinds of preconfigured options, like the sound to play when the notification arrives, what to do when the notification is opened, whether the app badge (the red circle on the app icon that lets you know when there’s unread content) should be incremented, and all kinds of other platform-specific actions or custom data.

Custom data can be very useful to include in a push notification.  It’s not visible to the user, but it provides information to the application that makes responding to the notification faster and more accurate.  For example, when you get a notification from LunchBunch that says someone has accepted your buddy request, that push notification also includes invisible information about the user like their username and real name.  Now when you open the app, that buddy will appear in your buddies list without having to refresh or sync with the server over the internet.  Pretty cool, huh?

In fact, sometimes all we care about is getting the data to the device, and there’s no need to bother the user with a visible alert.  In these scenarios, we can send a silent push notification. This isn’t just an alert that comes through without sound–the user actually won’t ever see the notification.  This allows the application to be updated in the background so that all of your information is up to date when you open the app next–just like in the buddy-request example above.  There are many times when this is useful, but the most straightforward example may be buddy removal. Let’s say you want to remove a buddy permanently from all of your bunches. It would be a little awkward to alert that user with a message that says you’re no longer friends. Instead, a silent push notification is sent that the other user’s device will receive and act upon (removing you from all of their bunches) without the user being notified.

We’ll be posting some technical articles for developers interested in integrating push notifications into their iOS/Android apps, and if there are any topics you are particularly interested in, please let us know in the comments below!

Ryan from The Bunch

Leave a Reply

Your email address will not be published. Required fields are marked *