How to add notifications to icon in iOS application
Asked Answered
G

2

8

I see that some applications in iPhone show a red circle with the number of notifications from the application, how is that done?

Gwenny answered 22/7, 2011 at 23:8 Comment(0)
S
21

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:99]

Zero value hides the badge.

Stereo answered 22/7, 2011 at 23:11 Comment(0)
B
2

It is called a Badge, and it is used for icons, tabbaritems mostly.

You can set it up like

UITabBarItem *featured = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFeatured tag:0]; 
featured.badgeValue = @"1";
Boost answered 22/7, 2011 at 23:19 Comment(1)
The question specifically referred to the badge on the Springboard, which was correctly answered by Jose.Rainstorm

© 2022 - 2024 — McMap. All rights reserved.