ios8.0之后注册通知中心

  UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                    UIUserNotificationTypeBadge |
                                                    UIUserNotificationTypeSound);
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
                                                                             categories:nil];
    [application registerUserNotificationSettings:settings];//通知中心设置参数
    [application registerForRemoteNotifications];//注册通知中心
 
 
IOS8.0之后在appdelegate里像这样注册通知中心,才能进行远程推送或者本地通知
原文地址:https://www.cnblogs.com/weiki/p/4409433.html