Skip to main content
May 25, 2013
Question

Adobe Air Push Notifications Not Working Anymore?

  • May 25, 2013
  • 3 replies
  • 2533 views

I had success using Urban Airship to add device tokens and send push notifications so I moved on to another part of the project. Now during final testing it doesn't work anymore.

I can't seem to register new device tokens. I even have tried a brand new test project with no luck. Has something changed I'm unaware of? Here is the code to the simple test project that doesn't work. It seems as though RemoteNotificationEvent.TOKEN never fires. RemoteNotifier.subscribe does fire properly and there is a prompt on the device to enable push notifications but tokenHandler just doesn't trigger. I added a simple callback at the beginning of tokenHandler and nothing ever happened. Any ideas?

private function onAdded(e:starling.events.Event):void {

var preferredStyles:Vector.<String> = new Vector.<String>();

preferredStyles.push(NotificationStyle.ALERT, NotificationStyle.SOUND);

var subscribeOptions:RemoteNotifierSubscribeOptions = new RemoteNotifierSubscribeOptions();

subscribeOptions.notificationStyles = preferredStyles;

var remoteNotifier:RemoteNotifier = new RemoteNotifier();

remoteNotifier.addEventListener(RemoteNotificationEvent.TOKEN, tokenHandler);

if (RemoteNotifier.supportedNotificationStyles.toString() != "") {

remoteNotifier.subscribe(subscribeOptions);

}

}

public function tokenHandler(e:RemoteNotificationEvent):void {

var urlReq:URLRequest = new URLRequest(new String("https://go.urbanairship.com/api/device_tokens/" + e.tokenId));

urlReq.authenticate = true;

urlReq.method = URLRequestMethod.PUT;

URLRequestDefaults.setLoginCredentialsForHost("go.urbanairship.com", "secret", "secret");

var urlLoad:URLLoader = new URLLoader();

urlLoad.load(urlReq);

}

This topic has been closed for replies.

3 replies

Participant
June 27, 2013

im having the exact same problem and ive tried everything. im finishing a huge project and this really makes me sick. im sure the problem is not on the urban airship side because then there was a different error seen. i've redone everything from the scratch twice and still nothin. im pretty sure urban airship receives nothing from the app and TOKEN function is just not fired.Pls tell have you found any solutions or workarounds (besides changing platforms)?

June 27, 2013

I eventually just scratched all code related to push notifications and started over. There was no reason for it to stop working, but it definitely was on the coding side.

Participant
June 27, 2013

Hello munkeymike , I am also facing the same problem ,the certificates and the provisioning seems to be fine , is this a bug on the developers end .?

kglad
Community Expert
Community Expert
May 25, 2013

is your apple developer license still valid?  has your apple certificate expired?

May 25, 2013

Both are still valid.

kglad
Community Expert
Community Expert
May 25, 2013

if you haven't exceeded your urban airship message quota, contact them to see if there's an issue.

post back here when you get a response.