Skip navigation
Currently Being Moderated

iOS - Can you manually adjust badge on app icon?

Sep 5, 2012 9:00 AM

My app is just a brochure. Users can download compatible files to view (DOC, PPT, PDF, XLS, MP4, etc). If a newer version of a previously downloaded file is available I'd just like to update the badge icon on the app to alert the user their downloaded resources have updates.

 

So far all I see as a way to update a badge icon (outside previous ANEs that are said to be malfunctioning) is the new AIR 3.4 push notification updates. I see you can register to receive PUSH and if RemoteNotifier receives a notification event of type RemoteNotificationEvent.TOKEN it can adjust the badge?

 

I only wish to set the app icons badge number manually from inside the app, after I determine if there's any resources that need updating. I don't need push services. Is there an easy means that I'm simply not seeing to adjust the badge, such as somehow faking a RemoteNotificationEvent.TOKEN event or any classes I'm not seeing inside flash.notifications.*?

 

Thanks for any tips!

 
Replies
  • Currently Being Moderated
    Sep 5, 2012 9:33 AM   in reply to sinious

    Updating badge from inside the app is a type of local notification. Unfortunately, local notifications are still not suppored in AIR. However, you can use native extensions for the same.

    Some of the ANE links to get you started

    http://juankpro.com/wordpress/2012/05/10/local-notification-ane-source -code/

    http://www.as3gamegears.com/air-native-extension/local-notifications/

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 5, 2012 10:35 AM   in reply to sinious

    Did not understand your comment "Ah so by the time the app gets the event the iOS has already handled the local notification elsewhere. So AIR itself isn't doing it."

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 6, 2012 9:33 AM   in reply to sinious

    You are mostly correct except the fact that on iOS, the OS may handle the notification and application may never get to know about it.RemoteNotificationEvent.NOTIFICATION is fired only in following two scenarios:

    1. The application was in foreground when remote notification was received.
    2. The application was not in foreground when notification was received and as a result of the presented notification, the user taps the action button of the alert.

    If the notification is delivered when the application isn’t running in the foreground, the system presents the notification, displaying an alert, badging an icon, perhaps playing a sound. And hence the event will not be dispatched. In other words, this event will NEVER be fired if application was in background(sleeping/dead) and user ignores the notification.

    Please refer to http://blogs.adobe.com/airodynamics/2012/05/29/push-notifications-supp ort-in-ios/ for more details.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2012 9:11 AM   in reply to sinious

    Yes! it fixes the issue!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points