Android Push Notifications with Urban Airship
Hi everyone,
I'm currently building an app on iOS and Android.
First thing I want you to know: the push notifications were quite easy to set up on iOS. Works great so far.
Troubles began when I tried to develop the Android version. I found several useful links about that, but I wasn't able to connect the dots yet.
So I thought it would be a good idea to ask: has someone succeeded to set up push notifications in Android?
Here are the things I've read/tried:
- Official UrbanAirship announce of Android Push Notification support. But they seem to install their own "app" to enable push notifications for devices with Android SDK > 1.5
 - The official Google documentation for C2DM, which enable push notifications for devices with Android>2.2 only
 - The module provided by the Titanium team. It says it's compatible with Android and iPhone…but what is the equivalent of the 
Ti.Network.registerForPushNotificationsmethod? If there is no equivalent (and I think it's the case, since the documentation says it's an iPhone only method), how can I retrieve the token? From the documentation of this module:token[object]: A blob object containing the device's token. This should be obtained by a Ti.Network.registerForPushNotifications() callback. - Here is a ticket (#1919) which contains an interesting discussion about Android Push Notifications implementation with C2DM
 - The GitHub repo of the source code indicated in the ticket #1919. I could build the module, but I couldn't figure out the correct use of it and what it offers exactly.
 
Sorry for the lengthy post.
Any help is greatly appreciated! :)
Cheers,
Arnaud.
6 Answers
- 
				
					
I'm interested in this as well.. trying to import my push enabled app from iPhone to Android.
Thanks for the detailed info Arnaud.
 - 
				
					
does you guys found anything. i am stuck on this also
 - 
				
					
Interested in this as well!
 - 
				
					
It is awesome the lack of support on this. Seems like everyone is wondering the same thing and Ti is doing nothing about it.A year has passed and we still dont know how to register android device using UA module
 - 
				
					
Hi guys,
I registered to UrbanAirship, but I can't receive push notification on the device. On UrbanAirship, it said that it's goes out, but I can't get it on the phone.
Here's the code for Android:
UrbanAirship.pushEnabled = true; UrbanAirship.showOnAppClick = true; UrbanAirship.tags = ["android"]; //var c2dm = UrbanAirship.c2dmId; function eventCallback(e) { if (e.clicked) { Ti.API.info('User clicked a notification'); } else { Ti.API.info('Push message received'); } Ti.API.info('Message: ' + e.message); Ti.API.info('Payload: ' + e.payload); } function eventSuccess(e) { Ti.API.info('Received device token: ' + e.deviceToken); } function eventError(e) { Ti.API.info('Error:' + e.error); var alert = Ti.UI.createAlertDialog({ title: 'Error', message: e.error }); alert.show(); } UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_CALLBACK, eventCallback); UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_SUCCESS, eventSuccess); UrbanAirship.addEventListener(UrbanAirship.EVENT_URBAN_AIRSHIP_ERROR, eventError);Don't forget the airshipconfig.properties file. You must put it in your [APPDIR]/platform/android/bin/assets/airshipconfig.properties folder.
Look at the documentation. It's help me to register. Now I have to figured out why I don't get the push.
Hope this help.
Daniel
 - 
				
					
Yeah, i have the right one since the android package is there, and I cant find the way to remove the module cuz i was looking to do that before. Some modules have a way to remove once you mouse over it but UA is one of the ones that when you mouse over the black settings layer is not there.
So, any ideas how you remove UA from 'your products'?
thanks