Question

I've been trying to get my phonegap/android application to register for push notifications with urban airship, but it isn't working. I've followed the documentation/guide here: http://docs.urbanairship.com/build/phonegap.html#setting-up-your-application-with-urbanairship

While the app builds and communicates something to urban airship -- I can see the number of opens -- it will not register a device id for push with them. I did the automatic integration from the above link and it seemed to install the plugin without any errors.

It's unclear how much of this page I'm supposed to do: http://docs.urbanairship.com/build/android.html#urban-airship-setup. I set up GCM with google, the app with urban airship, and the server key from google, as well as the airshipconfig.properties file and the www/config.xml file. But then it says to download the jar from their website - I already have a jar by the exact same name in platforms/android/libs/ that seems to have been installed when I used the 'phonegap plugin add' command from the first link in the 'automatic integration' section. It then goes on to talk about modifying the AndroidManifest file, most of such modifications already are there. So it seems those sections are not meant for Phonegap users.

However - the app does not register, so I must have done something wrong or skipped something. To make this more complicated, I can't find a way to get a meaningful error message. In my phonegap js code I can do alert() calls, but that doesn't tell me anything about UA/push/registration configuration problems that might be happening but not affect the app build process. All I know is that the 'register' event that's supposed to happen isn't being triggered.

Has anyone been through this process before/recently? I've found a handful of similar questions and guides, but they're all concerning older versions of phonegap and urban airship and haven't been much help so far. Neither has urban airship support, who told me they don't help people with specific implementations (of course I didn't expect them to, it was a shot in the dark).

Anyway, thanks for your help and for reading this if you've made it this far.

Was it helpful?

Solution

The answer is something the documentation is not entirely clear about - Android apps don't register for push notification at all. The guides were otherwise correct. Once I realized I didn't have to wait for registration, I tried sending a push from UA website, and it worked.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top