标签:ios
UIApplication *APPLICATION = [UIApplication sharedApplication]; // ios 8 if ([APPLICATION respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeSound| UIRemoteNotificationTypeAlert)categories:nil]; [APPLICATION registerUserNotificationSettings:settings]; [APPLICATION registerForRemoteNotifications]; } else { // ios7 [APPLICATION registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert)]; }
标签:ios
原文地址:http://blog.csdn.net/rainlesvio/article/details/40392413