• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adobe Air Push Notifications Not Working Anymore?

Guest
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

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);

}

TOPICS
ActionScript

Views

2.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

Both are still valid.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

I definitely have not exceeded my quota (I have only sent a total of maybe 16 messages) and their servers are never even contacted so I don't believe it is their fault. The TokenHandler function never fires. In other words, RemoteNotificationEvent.TOKEN never happens.

To my understanding, RemoteNotificationEvent.TOKEN occurs when the user accepts the push notifications. I've also listened to the StatusEvent of RemoteNotifier and nothing...?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 28, 2013 May 28, 2013

Copy link to clipboard

Copied

Apparently RemoteNotificationEvent.TOKEN occurs when Apple's servers return a token which leads me to believe there is something wrong with the connection between Air and APNS. Still no success after re-downloading and implementing all certs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 28, 2013 May 28, 2013

Copy link to clipboard

Copied

i still recommend checking with urban airship.  they should be in a good position to know if there was a recent change both on their end and apple's.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

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 .?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

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)?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

I could get it working , I had made a mistake with setting the entitlements in the app descriptor,the iphone configuration utility was extemely helpful, although I encountered an unusual bug

"no valid aps-environment entitlement string found for application" googling this gives to strange solutions seems like a lot of native developers are also facing a lot of problems with this bug.

Some of them suggest us to download the developer certicate again which does not make much sense, lost a lot of time reading all those fixes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2013 Jun 27, 2013

Copy link to clipboard

Copied

Ok. thanks for the post. However can you now give a final and definite answer to the following:

1. What should the APP id in the descriptor file be? is the suffix (<id>whatever.whatever</id>) enough or do you need to include the prefix number also?

2. What exactly should be used in <entitlements> application-identifier  tag? the whole app id (prefix number AND suffix)?

3. What did you add to to <entitlements> keychain-access-groups? <prefix number.*> ?

i dunno if those values actually affect identifying the app so much however there's a lot of fuzz about what exactly should be used.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2013 Jul 01, 2013

Copy link to clipboard

Copied

You dont require the prefix number

the Entitlements is as simple as this

<Entitlements><![CDATA[<key>aps-environment</key>

        <string>development</string>]]></Entitlements>

Try to check  if the app id in the application and bundle ID in  urbanairship match

Also check out if the App ID has push notifications enabled in the member centre

Also always test on a 3G connection , there might be cases where everything is correct but the firewall on the WIFI is blocking it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 11, 2013 Jul 11, 2013

Copy link to clipboard

Copied

LATEST

1. It should just be <id>toplevel.domain.subdomain</id>. No prefix here.

2. I don't believe you need a application-identifier or keychain-access-groups tag. Here's what I use (change production to development if necessary):

<Entitlements>

          <![CDATA[

                    <key>aps-environment</key>

                    <string>production</string>

          ]]>

</Entitlements>

3. Same as above, not necessary.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines