1.将app的BadgeNumber设为0,就是app图标右上角那个
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
2.如果BadgeNumber本身就是0的情况,可以先将其设1再设置成0
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:1];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
3.如果以上的办法都不好使的话,那就用本地通知欺骗一下。
UIApplication* application = [UIApplication sharedApplication];
NSArray* scheduledNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications];
application.scheduledLocalNotifications = scheduledNotifications;
NSArray* scheduledNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications];
application.scheduledLocalNotifications = scheduledNotifications;