Urban Airship, Push Notifications on Android, and C2DM Tokens
I’m working on a cross-platform mobile app with the following technologies:
- JQuery Mobile
- PhoneGap
- Urban Airship
- C2DM (for Android push notifications)
While in the Urban Airship web console, I was creating a new application when I came upon the section specific to Android. The first field, Android Package, was easy enough (com.mobile.app). But I wasn’t quite sure what to put in the C2DM Authorization Token field.
After further research, I found I have to manually register for the Android C2DM service. My access was approved about two hours later.
Next step, how to create that C2DM Authorization Token? Luckily, Urban Airship provides a Python script to create the token. Within the Urban Airship Android download, there is a script named clientauth.py under the tools directory.
Just run clientauth.py, enter the Google account that was approved for access, enter your account password, and clientauth.py will print the your C2DM authorization token. Make sure to keep this token! Then paste the token into the Urban Airship field and you’re ready to create your Urban Airship application.