Urban Airship and Android

I’m researching push and have successfully gotten Android push to work both from my own server and with Pushwoosh. But it looks like Urban Airship is my best option but I can’t get device registration to work with Android. Not that iOS is working either but lets start with Android.

My code is as follows:

-- Code uses pr() function that is not included. It just dumps out table values for debugging local function registerWithUrbanAirship ( deviceToken ) -- Catch whatever Urban Airship returns local function urbanNetworkListener( event ) if ( event.isError ) then pr(event, 'Urban airship not responding') else pr(event, 'Urban airship response') end local mime = require( "mime" ) local APPKEY = "XXXXXXXXX" local APPLICATIONSECRET = "XXXXXXXXX" -- I have tried skipping this encryption but same result. local secretString = mime.b64(APPKEY .. ":" .. APPLICATIONSECRET) local headers = {} headers["Authorization"] = "Basic " .. secretString headers["Content-Type"] = "application/json" local params = {} params.headers = headers params.body = "" network.request( "https://go.urbanairship.com/api/device\_tokens/" .. deviceToken, "PUT", urbanNetworkListener, params) end local function onNotification( event ) if event.type == "remoteRegistration" then pr(event, 'remote registration') registerWithUrbanAirship ( event.token ) else -- A push notification has just been received. pr(event, 'Notification recieved') end end Runtime:addEventListener( "notification", onNotification )

Android results from pr() function:

remote registration = { | type = "remoteRegistration", | name = "notification", | token = "tokenEditedOut", }, Urban airship response = { | responseHeaders = { | | Connection = "close", | | Content-Length = "222", | | Date = "Tue, 04 Jun 2013 05:19:39 GMT", | | X-Android-Sent-Millis = "1370323178437", | | Expires = "Tue, 04 Jun 2013 05:19:39 GMT", | | X-Android-Received-Millis = "1370323178599", | | Content-Type = "text/html", | | Mime-Version = "1.0", | | HTTP-STATUS-LINE = "HTTP/1.1 411 Length Required", | | Server = "AkamaiGHost", | }, | responseType = "text", | phase = "ended", | bytesEstimated = 222, | response = "\<HTML\>\<HEAD\> \<TITLE\>Bad Request\</TITLE\> \</HEAD\>\<BODY\> \<H1\>Bad Request\</H1\> Your browser sent a request that this server could not understand.\<P\> Reference&#32;&#35;7&#46;55acefca&#46;1370323179&#46;42a5a31 \</BODY\> \</HTML\> ", | name = "networkRequest", | bytesTransferred = 222, | status = 411, | url = "https://go.urbanairship.com/api/device\_tokens/myTokenEditedOut", | isError = false, | requestId = "false", },

I found this quote from Urban Airship: “You must have our Android library in your project to use our push services”

So it might not be possible to use Corona at all then? Anyone got Urban Airship working with Android? 

I am looking for Corona and UrbanAirship solutions as well, I found this that looks promising.

http://forums.coronalabs.com/topic/15967-corona-sdk-push-notifications-and-urban-airship-solved/

I’m trying it out now and will let you know if it works out.

I found this quote from Urban Airship: “You must have our Android library in your project to use our push services”

So it might not be possible to use Corona at all then? Anyone got Urban Airship working with Android? 

I am looking for Corona and UrbanAirship solutions as well, I found this that looks promising.

http://forums.coronalabs.com/topic/15967-corona-sdk-push-notifications-and-urban-airship-solved/

I’m trying it out now and will let you know if it works out.

Same problem.

I don’t think you can do this anymore - I think you need to install their SDK which is impossible with regular Corona.

A company called oneSignal does Push and they have a corona module and it worked straight away.

Same problem.

I don’t think you can do this anymore - I think you need to install their SDK which is impossible with regular Corona.

A company called oneSignal does Push and they have a corona module and it worked straight away.