iosnstimernstimeintervalbadgeapplication-icon

How to update ApplicationBadgeIcon in iPhone App?


I am using applicationiconbadge in my app. I am setting it to 100 and I have to decrement it till 0 and give some alerts in meanwhile. Now when I close my app by pressing homescreen, I can see badge on app icon but its not updating. I have used nstimer to decrement that counter after specific time period and update badgeicon accordingly but it seems not to be working.

Can anyone help me out here ?

Sumit


Solution

  • When your app is sent to the background, the system freezes it and no actual code can be running after that.

    What you should do is to schedule local notifications and decrease an application badge from there.