I have been working with local notifications. But the problem is the application icon badge number is not incrementing with local notifcations fired. I tried .applicationIconBadgeNumber+1;
But it's not giving any effect. The application icon badge number is always 1.
enter code here
UIApplication *app=[UIApplication sharedApplication];
notifyalarm.applicationIconBadgeNumber=[UIApplication sharedApplication] .applicationIconBadgeNumber+1;
After seeing your code I would suggest to use following before setting badge value
NSUserDefaults* userDefs = [NSUserDefaults standardUserDefaults]; //old val NSInteger iconBadge = [userDefs integerForKey:@"myBadgeVal"]; //updatge val iconBadge++; //store [userDefs setInteger:iconBadge forKey:@"myBadgeVal"]; [userDefs synchronize]; //set as icon badge notifyalarm.applicationIconBadgeNumber=iconBadge;
However I'm not sure when 'save' method is called. Make sure this method is called as many times as you expect.
You have to handle locally this number, as [UIApplication sharedApplication] .applicationIconBadgeNumber will always be 0(as you do not update this value anywhere). You could use NSUserDefaults if you wish. Also please provide some code so we can be more helpful.