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