APPDelegate添加下
由于版本更新,需要增加下判斷额嘿。
if ([[UIDevice currentDevice].systemVersion doubleValue] >= 8.0)
{
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIUserNotificationSettings *notificationSettings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
[[UIApplication sharedApplication]setApplicationIconBadgeNumber:EmmEmiUnread];
}
else
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UIRemoteNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:types];
[[UIApplication sharedApplication]setApplicationIconBadgeNumber:EmmEmiUnread];
#pragma clang diagnostic pop
}
需要討論的可以下邊留言绊诲,歡迎一起進步!栓袖!
隨手一記匣摘! ?(? ? ??)