Tuesday, October 4, 2011

Manipulating the icon badge numbers from an iOS FireMonkey application

Q: How do I update those little numeric indicators on my app's icon to show how many notifications the user should have?
A: By using setApplicationIconBadgeNumber

Very simple unit that increments the icon badge number below.

Enjoy!

unit Unit1;

{$IFDEF FPC}
{$mode objfpc}{$H+}
{$modeswitch objectivec1}
{$ENDIF}

interface

uses
SysUtils, Types, UITypes, Classes, Variants, FMX_Types, FMX_Controls, FMX_Forms,
FMX_Dialogs
{$IFDEF FPC}
, iPhoneAll
{$ENDIF}
;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.lfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
{$IFDEF FPC}
UIApplication.sharedApplication.setApplicationIconBadgeNumber(UIApplication.sharedApplication.applicationIconBadgeNumber+1);
{$ENDIF}
end;

end.

51 comments:

  1. Asking questions are actually pleasant thing if you are not understanding anything fully, however this paragraph gives fastidious understanding yet.

    ReplyDelete
  2. First off I would like to say terrific blog! I had a quick question in which I'd
    like to ask if you don't mind. I was curious to know how you center
    yourself and clear your thoughts prior to writing.
    I've had difficulty clearing my thoughts in getting my ideas out.
    I truly do enjoy writing however it just seems like the first 10 to 15 minutes are usually wasted simply just trying to
    figure out how to begin. Any recommendations or tips?
    Appreciate it!

    ReplyDelete
  3. You might be living in a box if you haven't yet heard
    about the game series that has hooked people from all continents, Mafia Wars.
    Bingo games are games of fun and very thought-provoking.
    Vicky is a shy and small kid who wants to impress his father who is a strong Viking chief.

    ReplyDelete
  4. What a information of un-ambiguity and preserveness of valuable experience concerning unpredicted emotions.


    Take a look at my web-site :: BoomBeachGenerator.tk

    ReplyDelete
  5. That way, finding out how to copy PS3 games will be much more effortless than ever.
    Kids yoga has become increasingly popular as of late.

    We are clearly not saying that downloading games will be the absolute future of ALL
    video games purchases, but it will notably take
    a sizable share of retail sales from here on out.

    ReplyDelete
  6. Wow, amazing blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your site is magnificent, let alone the
    content!

    ReplyDelete
  7. Whilst this might sound odd considering that
    mobile computing (in notebooks, smart phones and tablet computers) is very common in today's society, it is important to note that - decades ago - computers used to be massive; in some cases, the
    size of a small room. The particular cell phone you
    use will identify if it is compatible together with your preferred software
    program. Even when you only own one particular game system, you'll find it awesome to
    have a program that could duplicate all games in case it's ever necessary.

    ReplyDelete
  8. You might be living in a box if you haven't yet heard about the game series that has hooked people from all continents,
    Mafia Wars. This means you are not fixed at a certain position,
    like in Counter Strike. Therefore, once they start the Hello Kitty
    coloring game, and they get to color all those images where the cute face
    of the little kitten appears, they are, no doubt, much more willing to
    play with the colors than if they had been forced to
    color a dull page from a coloring book.

    ReplyDelete
  9. If you would like to obtain a great deal from this paragraph then you have tto apply such techniques to your won weblog.

    ReplyDelete
  10. You are so awesome! I don't believe I have read through a single thing like that before.
    So wonderful to discover another person with unique thoughts on this topic.
    Really.. thanks for starting this up. This site is one thing that is needed on the web, someone with a little originality!


    My page: paysafecard generator

    ReplyDelete
  11. Now if children are not interested in something they
    just leave it. The particular cell phone you use will identify if it is
    compatible together with your preferred software program.
    Remember, opening an account with a bookmaker should
    not cost you money.

    ReplyDelete
  12. However, does one truly opt for the guaranteed SEO skilled for your on-line
    website promotion campaign. At some point when you've been dating
    long enough, you might introduce your friends
    to your date. Visit their sites and see how do they treat their business.

    ReplyDelete
  13. Once you choose a hotel, the app takes you to a complete profile page, including
    photos, to show the room accommodations, hotel property and attractions.

    If any of these tests are positive, the Dubai Medical for Visa can get
    rejected and the visa denied, based on the discretion of the Health Authority.

    The fastest way is by pre booked Licensed Private Hire Company via the website
    in advance to avoid disappointment.

    ReplyDelete
  14. That way, finding out how to copy PS3 games will be much
    more effortless than ever. Bingo games are games of fun and very thought-provoking.
    Therefore, once they start the Hello Kitty coloring game, and they get to
    color all those images where the cute face of the
    little kitten appears, they are, no doubt, much more willing
    to play with the colors than if they had been forced to color
    a dull page from a coloring book.

    ReplyDelete
  15. After going over a handful of the articles on your web page,
    I seriously like your way of blogging. I added it to my bookmark webpage list and will be checking back in the near future.

    Take a look at my website as well and let me know what you think.

    ReplyDelete
  16. Whilst this might sound odd considering that mobile computing (in notebooks,
    smart phones and tablet computers) is very common in today's society, it
    is important to note that - decades ago - computers used to
    be massive; in some cases, the size of a small room.
    Kids yoga has become increasingly popular as of late.
    The story of The Incredibles is about a family of superheroes with unique skills and they try to
    save the world with the powers that they have been blessed with.

    ReplyDelete
  17. The mini games include the favorites like Link, Mario and Yoshi,so make sure you try out
    the puzzle games, they are a lot of fun but tricky.

    You must also look at the terms and conditions of the gaming
    site before becoming the member. Therefore, once they start the Hello Kitty
    coloring game, and they get to color all those images
    where the cute face of the little kitten appears, they are,
    no doubt, much more willing to play with the colors than if
    they had been forced to color a dull page from a coloring book.

    ReplyDelete
  18. Hey just wanted to give you a quick heads up. The text
    in your content seem to be running off the screen in Opera.

    I'm not sure if this is a formatting issue or something to do with web browser
    compatibility but I thought I'd post to let you know. The design and style look great though!
    Hope you get the problem solved soon. Cheers

    ReplyDelete
  19. You might be living in a box if you haven't yet heard
    about the game series that has hooked people from all continents, Mafia Wars.
    However, this does not mean that they lack in knowledge and skill to operate a smaller aircraft, in fact,
    a private pilot can comfortably fly a plane from one
    airport to another. The story of The Incredibles is about a
    family of superheroes with unique skills and they try to save the world with the powers that they have been blessed with.

    ReplyDelete
  20. Hi there, You have done an incredible job. I will definitely digg it and personally recommend to my
    friends. I'm confident they'll be benefited
    from this website.

    ReplyDelete
  21. I love reading through an article that will make men and women think.

    Also, thank you for allowing for me to comment!

    ReplyDelete
  22. What's up every one, here every one is sharing such experience, thus it's
    pleasant to read this blog, and I used to go to see this blog daily.

    ReplyDelete
  23. Yesterday, while I was at work, my cousin stole my iphone and tested to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My
    iPad is now destroyed and she has 83 views. I know this is completely off topic but I had
    to share it with someone!

    ReplyDelete
  24. As lentes racistas brasileiras impossibilitam que
    se enxergasse competência mental e cognitiva no futebol praticado pelo negro.

    ReplyDelete
  25. It's a shame you don't have a donate button! I'd certainly donate
    to this excellent blog! I suppose for now i'll settle for
    book-marking and adding your RSS feed to my Google account.

    I look forward to new updates and will share this blog with my Facebook group.
    Chat soon!

    ReplyDelete
  26. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically
    tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping
    maybe you would have some experience with something like this.
    Please let me know if you run into anything. I truly enjoy reading
    your blog and I look forward to your new updates.

    My homepage :: Jodi

    ReplyDelete
  27. Hello very cool site!! Man .. Beautiful .. Superb
    .. I will bookmark your blog and take the feeds also?
    I am happy to find numerous helpful information here in the put up, we need work out extra strategies on this
    regard, thank you for sharing. . . . . .

    ReplyDelete
  28. Given that all discs will eventually get destroyed, this does not justify the option to
    buy a new game of the same title. The particular cell phone you use will identify if it is compatible together with your preferred software program.
    Or you could judge a game's success based solely off
    of its commercial success.

    ReplyDelete
  29. Given that all discs will eventually get destroyed, this does not justify
    the option to buy a new game of the same title. However, this does not
    mean that they lack in knowledge and skill to operate a
    smaller aircraft, in fact, a private pilot can comfortably fly a plane from one airport to another.
    Remember, opening an account with a bookmaker should not cost you money.

    ReplyDelete
  30. Please let me know if you're looking for a author for your site.
    You have some really great posts and I think I would
    be a good asset. If you ever want to take some of the load
    off, I'd love to write some articles for your blog
    in exchange for a link back to mine. Please blast me an e-mail if interested.
    Kudos!

    Also visit my page :: Torsten

    ReplyDelete
  31. Now if children are not interested in something they just leave it.
    According to stress is defined as, "A constraining force or influence as a physical, chemical, or emotional factor that causes bodily or mental tension and may be a factor in disease causation (2011). The story of The Incredibles is about a family of superheroes with unique skills and they try to save the world with the powers that they have been blessed with.

    ReplyDelete
  32. This information is priceless. Where can I find out more?

    ReplyDelete
  33. Amazing! Its in fact remarkable post, I have got much clear idea concerning from this article.

    ReplyDelete
  34. I feel this is one of the such a lot vital info for me.
    And i am happy studying your article. However wanha commentary on few general things,
    The web sit taste is ideal, the articles is truly great : D.

    Excellent job, cheers

    ReplyDelete
  35. Hello! Would you mind if I share your blog with my
    zynga group? There's a lot of people that I think would really
    appreciate your content. Please let me know. Thank you

    ReplyDelete
  36. Hi my friend! I wish to say that this post is awesome, great written and include
    almost all vital infos. I would like to look extra posts like this
    .

    ReplyDelete
  37. You might be living in a box if you haven't yet
    heard about the game series that has hooked people from all continents, Mafia Wars.
    You must also look at the terms and conditions of the gaming site before becoming the member.
    The story of The Incredibles is about a family of
    superheroes with unique skills and they try to save the world with the powers that
    they have been blessed with.

    ReplyDelete
  38. Many young people are suffering from poor eating habits,
    these days. These can develop muscle strength as
    well as hand-eye coordination. Remember, opening an account with a bookmaker should not cost you money.

    ReplyDelete
  39. Now if children are not interested in something they just leave it.
    Although paintball paints should be washable, they might leave permanent stains on certain types of clothing material.
    The story of The Incredibles is about a family of superheroes with unique skills and they try to save the world with the powers
    that they have been blessed with.

    ReplyDelete
  40. Studies are finding that specifically designed music for young children can help therapists
    who work with children with autism. Even if you
    can't sing very well, show your child this range in your own voice.
    s cognitive skills such as spatial reasoning and memory.

    ReplyDelete
  41. Very nice post. I just stumbled upon your weblog and wished to say that I've
    truly enjoyed surfing around your blog posts. After all I'll be subscribing to your
    rss feed and I hope you write again soon!

    ReplyDelete
  42. What a material of un-ambiguity and preserveness of precious know-how concerning unpredicted feelings.

    ReplyDelete
  43. I couldn't refrain from commenting. Exceptionally well written!

    ReplyDelete
  44. Article Source: Sharma is an employee of Cox and Kings Global Services.
    Some of the islands, which need to be visited, are Trinidad and Tobago, Jamaica and the
    Lesser Antilles. This bending of space is what is called a wormhole.

    ReplyDelete
  45. This article provides clear idea in favor of the new people of blogging,
    that genuinely how to do blogging.

    ReplyDelete
  46. Have you ever been on a long trip with someone who had quite an irritating personality.
    Dining spend was down globally by an average of 1 percent.
    To learn about this amazing eco-tourism paradise, please visit
    and.

    ReplyDelete
  47. That way, finding out how to copy PS3 games will be much more effortless than ever.
    Although paintball paints should be washable, they might leave permanent stains on certain types of
    clothing material. Each animal card comes with its own identifiable attributes too -
    like the warthog increases in ferocity when it's provoked or the snake can sneak
    in for advanced strikes.

    ReplyDelete
  48. Given that all discs will eventually get destroyed, this does not justify the option to buy
    a new game of the same title. However, this does not mean that they lack in knowledge
    and skill to operate a smaller aircraft, in fact, a private pilot
    can comfortably fly a plane from one airport to another.

    In the end you will be less frustrated when you get the sleep you needed.

    ReplyDelete
  49. We stumbled over here by a different page and thought I might check things
    out. I like what I see so now i am following you. Look forward to looking
    at your web page yet again.

    ReplyDelete

Note: Only a member of this blog may post a comment.