开发者

badge number count increament

I have implemented the local notification concept, it is working properly but there is a problem in badge number it is not increamenting automatically as notifications occurs. I have got a link where solution for this problem is given but don't know how to use it in app delegate. Following开发者_如何学Go is the link... If someone know how to auto increament the badge number ,please provide me some solution.

https://github.com/csheldrick/UILocalNotification

Thanku very much.


When you create your local notification then before registring it with the system add this line of code.

localNotif.applicationIconBadgeNumber = [UIApplication sharedApplication].applicationIconBadgeNumber+ 1;

and then you register you notification with the system

[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];

localNotif is object of

UILocalNotification

Hope this helps


- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {

    [UIApplication sharedApplication].applicationIconBadgeNumber=application.applicationIconBadgeNumber+1;
}

i hope it will help ful to you

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜