Skip to main content
Inspiring
April 15, 2012
Answered

How to Reset Application Badge Count AS3

  • April 15, 2012
  • 4 replies
  • 1581 views

Hi,

I have successfully sent an apple push notification using a native extension for adobe air by anders-tbl. The notification simply sets the badge count to 1 and has a little message.

What confuses me is how do I reset this badge count once a user reopens my application or opens the application by clicking on the notification? The badge count always stays at 1 even if I delete the application and reinstall it, it’s still there!!??

I know I can reset the badge count by sending a notification with badge = 0, but I can't dynamically do this by sending an empty APN with badge set to 0 as you only get the device token on first application load? Surely you set this via some kind of AS3 function? I can’t seem to find any help searching google at all.

If anyone knows or can nudge me in the right direction on how you are suposed to do this that would be great.

Cheers,

This topic has been closed for replies.
Correct answer vabhatia

Push Notifications are currently not supported in AIR. I mean there is no public Actionscript API to enable Push Notifications in AIR on any platform. Hence there is no API in actionscript to reset the batch number(for iOS) either. Since you are using native extensions, you will have to solely rely on them to reset you badge number as well.

4 replies

vabhatiaCorrect answer
Adobe Employee
April 16, 2012

Push Notifications are currently not supported in AIR. I mean there is no public Actionscript API to enable Push Notifications in AIR on any platform. Hence there is no API in actionscript to reset the batch number(for iOS) either. Since you are using native extensions, you will have to solely rely on them to reset you badge number as well.

vestaxpdxAuthor
Inspiring
April 16, 2012

Thanks for your answer, I thought this was the case. As it happens there is a setLocalBadge() function in the native extension, I was being blind.

Will Adobe Air ever fully support APNS do you think?

Adobe Employee
April 16, 2012

You can learn more about the next AIR mobile and desktop features by applying for our private prerelease program. By doing so, you'll get to know the features of the upcoming release in advance!