- (void)updateIconBadgeNumber:(NSInteger)iconBadgeNumber {
UIApplication *application = [UIApplication sharedApplication];
if (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber_iOS_8_0) {
// iOS8 and later
if ([application currentUserNotificationSettings].types & UIUserNotificationTypeBadge) {
/*
バッチの更新処理
iOS8系の場合は[[UIApplication sharedApplication] currentUserNotificationSettings]で
更新可能か判断する必要がある
*/
application.applicationIconBadgeNumber = iconBadgeNumber;
}
}
else {
// under iOS7
application.applicationIconBadgeNumber = iconBadgeNumber;
}
}