ios8.0之后注册通知中心

  UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                    UIUserNotificationTypeBadge |
                                                    UIUserNotificationTypeSound);
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
                                                                             categories:nil];
    [application registerUserNotificationSettings:settings];//通知中心设置参数
    [application registerForRemoteNotifications];//注册通知中心
 
 
IOS8.0之后在appdelegate里像这样注册通知中心,才能进行远程推送或者本地通知
posted @ 2015-04-09 13:29  Meone  阅读(276)  评论(0编辑  收藏  举报