I want to cancel AllLocalNotifications and setApplicationIconBadgeNumber to 0 when my application is completed (either by the operating system, or by double-clicking the home button and killing the application). I just added these two calls to my main application delegation code:
-(void)applicationWillTerminate:(UIApplication *)application
{
[application cancelAllLocalNotifications];
[application setApplicationIconBadgeNumber:0];
}
Are existing notifications still running and the icon number remains set?
source
share