iOS applicationIconBadgeNumber(后台app红色角标)

float version = [[[UIDevice currentDevice] systemVersion] floatValue];

if (version >= 8.0) {
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
}
UIApplication *app = [UIApplication sharedApplication];
app.applicationIconBadgeNumber = 123;


你可能感兴趣的:(iOS applicationIconBadgeNumber(后台app红色角标))