Urban Airship is a push messaging API that streamlines the development of push notifications for your app, similar to what ActionBarSherlock does for the Android ActionBar. Once properly configured, Urban Airship will allows the user to send out push notifications across all platforms from a single dashboard, while providing the developer/owner with analytical reports on the effectiveness of their notifications.
Urban Airship’s Wallet Studio
Urban Airship’s other main product is their Wallet Studio (i.e. Apple Passbook and Google Wallet), which provides templates and a simple drag-and-drop interface to create a wallet program for your app. The Wallet Studio also provides usage statistics, like the push notifications.
Taking UrbanAirship Push Notifications for a test run
Developer’s website
Android API Documentation
UrbanAirship provides guides on getting started with their API on your platform of choice. While I would normally try iOS, recently I have been working more in Android so I decided to go with that.
I found some sample projects on their website, but was hit with an invalid development key error in Eclipse as soon as I tried to compile.
After reading more of the documentation, I realized I had to first set up the API keys with Google before I would be able to use push notifications. In the end this is how I made it work…
Step 1: Set up your API Key with Google
Before using push messages on Android, you must get a Google Cloud Messaging API key from Google. While I could rewrite the instructions provided by Urban Airship, they have already made very good ones, which you can find at the link below.
How to get your API key from Google
Google API Console
Step 2: Setting up GCM Support in your App
Register a developer’s account with Urban Airship create a new app. Configure the GCM in the Urban Airship Notification Services by going to Settings -> Services on the dashboard. Paste in the API key from the previous step and enter a unique package name. For more detailed instructions see the tutorial on their website.
Setting up GCM Support
Step 3: Get API Information
To validate my development key and fix the error I first received I needed some information form the API:
Project Number - This refers to the number located in the URL of your project in the Google API Console. For example, if your URL is:
then the project number is 531486353482. This number can also be found in the overview section on the dashboard:
App Key & App Secret - Located under Settings -> API Keys
Step 4: Fix Build Paths and Libraries
I had to play with the build paths of the libraries a bit before the code would compile, but it wasn’t that much trouble. If you’re using the sample projects you should be able to just right click on your project, select the proper Project Build Target, and add any libraries necessary. For the Rich Push Sample project you have to also import ActionBarSherlock, so I would start by fixing any errors in the ActionBarSherlock project. Make sure to try cleaning your project if you still receive errors after adding libraries.
Step 5: Add API information to Eclipse Project
The easiest way to add the App Key, App Secret, and Project number to was to go to assets -> airshipconfig.properties and paste them in the appropriate places. The project number referes to the gcmSender.
You can also set the App Key and Secret inside of MyApplication.java, but I found it easier to just do it inside of properties.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality✓ Free Actions
Free to watch • No registration required • HD streaming
Push notifications have become an almost untold "required" component of your app. Behind a plethora of reasons you may want to send a push notification to a user, there are also many choices for choosing a service to get the job done. I'm going to be outlining two main options that I personally like to use, Parse and Urban Airship (and a little bit of PushSharp).
Price
It's important to note that both services offer 1,000,000 push notifications free (per month). For most indie developers, that should easily hold you off. Price probably won't be the main selling point between the two services for you. But if you manage to go over 1,000,000 pushes, the pricing structure is a tad more interesting.
Parse: You can either pay $0.07/1000 extra pushes (at the free plan level), or pay $199/month for 5,000,000 push notifications and a $0.05/1000 overage fee.
Urban Airship: You pay $0.001 per extra push (as opposed to $0.00007 per extra push with Parse) at the free plan level. You can upgrade to another level, but pricing information isn't available as you have to "contact sales" for further pricing information.
Let's see how this breaks down graphically:
As you can see, Parse offers a much more viable solution if you surpass the 1,000,000 free plan limit. To be fair, Urban Airship probably has a more economical solution for pushes over 1,000,000, but I'm just working with what pricing is given on their website. Additionally, with Parse you get 1,000,000 free requests (to the data browser, with social plugins, etc.) with each plan. The moment you should switch from the Parse free to the Parse premium tier is when you're sending 1,285,700 pushes a month. Parse wins the pricing round!
Ease of Setup
Note: I will be doing a push tutorial for iOS only, although both services support push notifications for other platforms.
General Setup:
First, visit the iOS Provisioning Portal and click on the tab labeled "App IDs." (Skip to the next step if you already have created an App ID for the application you wish to add push to.) In the top-right corner, click "New App ID." Fill out the information on the form as recommended by Apple. You should be redirected to the main App IDs tab.
Find the application that you just created and click on the "Configure" button. Click the checkbox for "Enable for Apple Push Notification service." Two options should appear for configuring push SSL certificates. In this tutorial, we will only setup the development certificate, although the process for creating the production certificate is exactly the same. Follow the instructions given by the dialog.
After completing the process, download your certificate. Open it and Keychain Access should also open. In the entry created in Keychain Access for the certificate, right-click and chose the "Export" option. Make sure the specified file format is .p12.
You are also going to want to setup a Provisioning Profile for your app, so you can send test notifications to your device. Apple provides a document detailing exactly how to do this.
You're now done with the general process.
Parse:
Go to the Parse dashboard and create a new app. Navigate to the Settings pane and chose the "Push Notifications" tab on the left-hand side. You can enable client-push, which basically means that push notifications can be sent from within the app itself (and not just from the web dialog). Upload the .p12 you have generated, and you are good from the setup end.
Time to get the third-party bindings for the Parse library setup. Navigate to the MonoTouch Bindings repository on Github. You can clone the repository, or download the .zip file. Once you've done that, copy the Parse folder to the Desktop (or an easy-to-access location). Download the Parse iOS SDK (chose the "SDK Only" option), and put it in the Parse/binding/ directory. Open up Terminal and type the following command:
cd ~/Desktop/Parse/binding/
make
You should get a "Compilation succeeded" message. Check the /binding/ folder and you should find Parse.dll.
Open up MonoDevelop and create a new iOS application. Add the newly-created Parse.dll as a reference in the project. Update your Info.plist with the information you provided when you created the App ID (bundle identifier mainly).
Open up your AppDelegate.cs file and add a reference to the Parse library (ParseLib). The following code should be placed in the FinishedLoading method and will ask the user if it's okay for the application to send push notifications. Generally, you ask for permission for all types of push notifications in case you decide to use that type at a later time.
You are also going to want to setup your application to work with Parse, of which you use the following code. You can retrieve your Application and Client IDs from your application's Parse Dashboard.
Additionally, override the following two methods to get you up and rolling.
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
{
ParsePush.StoreDeviceToken(deviceToken);
}
public override void ReceivedRemoteNotification (UIApplication application, NSDictionary userInfo)
{
ParsePush.HandlePush(userInfo);
}
Deploy the application to your device for testing, access the Parse Dashboard for your app, and fire a test notification!
Bonus: You can do loads of other cool stuff and targeting with Parse Push Services, of which they have created a detailed guide on their website.
Urban Airship:
Create a new application with Urban Airship and provide all the necessary information, including uploading your .p12 certificate and click "Create your app."
If you haven't already, download the MonoTouch Bindings repository and navigate to the Urban Airship folder. Move it to a more accessible location, like the Desktop. Download the Urban Airship iOS SDK and move it to the /binding/ folder. As with Parse, run the following command in Terminal to build the .dll.
cd ~/Desktop/UrbanAirship/binding/
make
You should now have a .dll to work with! Open up MonoDevelop and create a new iOS project. Add the .dll we just built as a reference.
Add a new .plist file to the project and call it AirshipConfig.plist. Set the following values depending on whether you are building for production or using the development sandbox.
DEVELOPMENT_APP_KEY = "Your development app key";
DEVELOPMENT_APP_SECRET = "Your development app secret";
PRODUCTION_APP_KEY = "Your production app key";
PRODUCTION_APP_SECRET = "Your production app secret";
Open up AppDelegate.cs and reference the Urban Airship assembly. Add the following code (Note: taken from Urban Airship's tutorial. All I've done is converted the code to C#).
NSMutableDictionary takeOffOptions = new NSMutableDictionary();
takeOffOptions.SetValueForKey(new NSString("launchOptions"), new NSString("UAirshipTakeOffOptionsLaunchOptionsKey));
UAirship.TakeOff(takeOffOptions);
This is all the configuration code necessary to get push up and running. Now we need to add the code to ask the user for permission to send push notifications.
Great! Almost done! Now override the following methods to complete setup.
public override void WillTerminate (UIApplication application)
{
UAirship.Land();
}
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
{
UAPush.Shared.RegisterDeviceToken(deviceToken);
}
Now deploy to the device, visit the app's Urban Airship page, click Push Composer, and push your heart out!
Conclusion:
I gotta say I think that they are both pretty close on the setup end, but I have to give the edge to Parse. No .plist is required (not that that is a big pain) and line-wise Parse is simpler to setup and understand.
Ease of Use
Parse wins here I think. Although I think Urban Airship has a cleaner Push Compose page, I have to give the edge to Parse based on their documentation. Parse's docs team did a fantastic job and every feature of their product is thoroughly documented. But you could really go either way here.
Evaluating Other Options
There are certainly plenty of other services that do the exact same thing as Parse and Urban Airship's. Certainly, these are the two most encountered from what I've seen, and I believe them to be the best two options.
That being said, push notifications are an essential part of your app and you may want as much control as possible over the process. The only way to achieve this is to send your own notifications, which you can do through a tool like PushSharp. It is an open-source, server-side library that allows you to send push notifications to iOS, Mac OSX, Android, Windows Phone, and Windows 8. For those who have outgrown Parse or Urban Airship, or it is becoming too pricey, then PushSharp is a great option. There is even a Xamarin seminar about it.
Conclusion
Honestly, you can't go wrong with either option. I lean towards Parse. I think they are much more up-front with their pricing structure, have great docs, and provide a great overall experience. Urban Airship isn't necessarily bad, but against Parse I would certainly chose the latter.
Team ADX making a giant blimp to put on top of a pub crawler. Look for it on the road between Portland and Austin... Most likely the only blimp serving drinks at SXSW.