徽章图标

  •  

        UIApplication *app = [UIApplication sharedApplication];

        

    //    根据用户版本,获取用户权限

        if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8) {

            UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeBadge) categories:nil];

            [app registerUserNotificationSettings:settings];

        }

    //    设置徽章

        app.applicationIconBadgeNumber = 18;

    }

posted @ 2015-11-11 01:48  菜鸟boy  阅读(126)  评论(0编辑  收藏  举报