The Android notification bar is one of my favourite aspects of the OS – and I’m certainly not alone. Even iPhone fans succumbed to its lure when Apple introduced an identical feature with iOS 5.
It’s underutilised to say the least, with most notifications coming either from the phone itself or third-party apps letting you know who just tweeted you. Imagine if your website, computer, servers, desktop apps or pretty much anything else could send you important messages, updates and alerts straight to your Android.
That’s the idea behind Pushover: push messages, straight to your phone. Here’s how to get the most out of it.
How It Works
Notifications with Pushover
A push transmission, put simply, is when a message is forced to transmit at the time of sending. This is opposed to a ‘pull’ which requires a user to go get it from the server. For example, if you’re notified when someone tweets you then that’s a push notification. If you have to refresh from within the app then you’re ‘pulling’ in the notification.
Pushover works by receiving a notification on their servers from a program running on our computer or server, and then forcing that notification to appear on your Android device.
This is done via HTTP as basic text notifications. If your phone is connected to the Internet then it will instantly receive the notification from the Pushover servers. If not, it will remain there for 30 days until you do connect.
Your notifications are secure, as all transmissions are encrypted.
But how do the Pushover servers recieve notifications to send to an Android phone? Well, using basic code or third-party plugins, you can tell programs on your computer or website to notify you if certain things happen. For example, you could tell your web server to notify you when it’s near capacity, or instruct an open-source torrent downloader to notify you when a download is complete.
The possibilities are complex and endless, with just about anything you like having the ability to be flagged for notification.
Basic ‘Human’ Notifications
In its most basic form, Pushover allows you to set up an unlimited number of phones and send them all text notifications from the Pushover website. It’s a little archaic but could definitely be put to good use by organisations or groups. It’s really simple too.
Using the application, enter in a unique ID for your phone. This will attach that phone to the Pushover account enabling any transmission through that account (manual or otherwise) to be sent over HTTP to the phone.
Send notifications to any enabled devices
To transmit a notification to either a single phone or a group, simply sign into the Pushover website and fill in the message fields. Provided the phones are connected to the Internet, they should receive your notification within five seconds.
As Pushover is a new service there are not a lot of apps and websites that currently work with it. However, a few independent developers and sites have made notifications plugins for things such as IMs, battery levels of gadgets and server monitors. You can check them out here.
Integrating with Your Sites and Apps
This is where the true power of Pushover comes into play: giving you notifications about things that matter to you. For example, a sale on your ecommerce site, your server’s current capacity or a security alert in your home or on your website. The possibilities are endless when you consider that almost all new programs, devices and systems connect to the Internet.
Pushover’s API is inclusive of the popular programming languages Ruby, Perl, Python and PHP. Their website has code snippets which enable you to code notifications which can be sent to your device.
There is also support for Windows and UNIX operating systems, allowing you to insert the code snippets either into command lines or as shell scripts.
If you’re developing an app or program you’ll need to get an API key so Pushover can authenticate messages received from the app. To do this, simply register your app with them and you’ll be issued with a key. You can upload a custom logo which will appear alongside any notifications you issue.
You’ll also need to create user identifier codes and user names. These will enable Pushover to see who is on your network and enable you to select who you want to send messages to. Ideally, your app should allow users to register and automatically update the database of users, and also edit their username in the future.
The actual messages your app will send must contain at the very least a ‘message’ parameter. A ‘title’ parameter is optional – if you choose to leave it out, Pushover will display the recipient’s username by default. When a notification is required, you application should construct a POST request and send it to https://api.pushover.net/1/messages.json .
The message should contain the following:
token = J3IJDReXKyyNaC0QyomlYEEokJnyFe
user = ee85fr5ec9fheTgf983cdh00jk876
device = phone66
title = Backup finished - SQL1
message = Backup of database "example" finished in 16 minutes.
NB. The ‘token’ is your API token mentioned above.
To override a user’s ‘quiet-time’ settings in the case of an emergency (such as a security breach), include a ‘priority’ parameter and give it a value of 1.
The end result should be something similar to what you see below – a small message that appears at the top of the Android screen in the same manner as normal notifications.
Pushover is still new so there is virtually no community surrounding it. This means that, for now, a lot of the pioneering will have to be left to the more experienced among us. Overall, though, I think it shows great promise thanks to its relative simplicity and prospective uses with individuals and organisations.