if([UIDevice currentDevice].systemVersion.doubleValue<=8.0){
//把udid和bundleid发送给苹果的apns服务器
[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert];
}else{
/**
UIUserNotificationTypeBadge UIUserNotificationTypeSound UIUserNotificationTypeAlert
*/
UIUserNotificationType type=UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert;
UIUserNotificationSettings *set=[UIUserNotificationSettings settingsForTypes:type categories:nil ];
[application registerUserNotificationSettings:set];
//主动申请
[application registerForRemoteNotifications];
}