Search code examples
objective-cios4

How to increase/update badge no of localNotification


I have made a birthday reminder application using localNotification.

It read the contacts from AddressBook & find out birthday list of that day(today).

I am repeating this app everyday using localNotification.repeatinterval(NSDayCalenderUnit).

It's working fine for me.

When I got a notification very 1st time it's badge no is 1(no problem),but if i close the notification & let the app is running in background & i got one other notification on next day.(then it's badge no should be 2).

So please help me by guiding how can I increase this badge no. count when I close the notification while my app is running in background.

I don't know when app is running in background through localNotification.repeatinterval which of the method if fired.

I would appreciate any help.


Solution

  • There is no built in functionality in UILocalNatification for auto-incrementing of badge number. you need to provide badge number for every single notification.