Urban Airship 1.0 integration with an Android Phonegap app

___

Since I wrote my previous post, UrbanAirship has released the final version of their android library. Oh well... the new version comes with some new shiny features like analytics for your app, the means to customize the look and feel of notifications (including sounds) and the possibility of using C2DM as your transport medium instead of helium. (It seems this feature was already present in the version I was using before but the docs back didn't mention it). Here you can find an updated howto of how to integrate it into your phonegap project:

AndroidManifest.xml

PushNotification.js

PushNotificationPlugin.java

MainApplication.java

MainActivity.java

IntentReceiver.java

Follow the rest of the instructions regarding airshipconfig.properties and you will be set. The folks from UrbanAirship suggested me that I should mention that most of the people will want to use the c2dm transport instead of helium. Check out their plans and decide by yourself what are your requisites and whether the basic plan fits your needs or go premium instead.

This is an example airshipconfig.properties:

developmentAppKey = yourDevelopmentAppKey
developmentAppSecret = yourDevelopmentAppSecret
productionAppKey = yourProductionAppKey
productionAppSecret = yourProductionAppSecret

#transport is "helium", "c2dm" or "hybrid"
transport = c2dm

c2dmSender = [email protected]
inProduction = false

You just need now to generate an auth token executing python ua-android-lib-latest/tools/clientauth.py and paste the result in the "C2DM Authorization Token" of your urbainairship app (webpage).

I've uploaded to my github account a sample project that you can use as a base for your app. Please have a look and let me know what you think.

UPDATE: Added UAirship.land() in onStop()

UPDATE2: Mention that c2dm should be used instead of helium, show how to configure a C2DM based app. Add a sample project that summarizes this post.

UPDATE3: UrbanAirship is officially supporting PhoneGap 2.0, check out https://github.com/urbanairship/phonegap-ua-push


comments powered by Disqus

Last posts

___

post thumbnail

Urban Airship 1.0 integration with an Android Phonegap app

post thumbnail

Urban Airship integration with an Android Phonegap app

post thumbnail

Sitemaps for Django static pages

post thumbnail

What I've been up to

post thumbnail

python-messaging: SMS encoder/decoder for the masses

post thumbnail

reStructuredText directive for google-code-prettify

post thumbnail

Playing with QML and DBus (Part 2)

post thumbnail

Playing with QML and DBus (Part 1)

post thumbnail

Testing ntrack

post thumbnail

minimoesfuerzo.org site details

Scroll top