Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

appBadge - how to use without push notifications

I wonder if we can use the app badge property without the push notification system. Is it possible to call an event in the application to check the badge value? or do we need to use the push method? Is there any event called when the app is shown on the iphone screen?

— asked July 9th 2010 by Jean Francois Blachon
  • appbadge
  • iphone
0 Comments

3 Answers

  • Jean Francois, you can set the app badge via push (we do that with Urban Airship) or directly within the app. Second option is shown as example here:

    Titanium.UI.iPhone.appBadge=2; //set a 2 as badge number 
    Titanium.UI.iPhone.appBadge=Titanium.UI.iPhone.appBadge+1; //increment
    

    …so easy it is! I just added app-inside badge support yesterday with just 2 lines of code. Thanks to Titanium for making that so easy!

    — answered July 10th 2010 by Sebastian
    permalink
    1 Comment
    • It seems to no longer work quite like that. But there is a setter method you can use

      — commented January 4th 2012 by Glenn Franxman
  • There is an article on Push Notification on the developer's blog.

    — answered July 10th 2010 by Peter Lum
    permalink
    0 Comments
  • ya but doe it increment when the app in on background or closed??

    — answered February 19th 2014 by mithila abeysekera
    permalink
    1 Comment
    • If you use ACS just send, in the payload, the badge value = +1

      — commented July 16th 2014 by Carlos Ceja
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.