注册推送通知

应用程序启动的时候,在启动函数中加入:

 UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                 UIUserNotificationTypeBadge |
                                                 UIUserNotificationTypeSound);
 UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil];
 [application registerUserNotificationSettings:settings];
 [application registerForRemoteNotifications];
原文地址:https://www.cnblogs.com/hd1992/p/6004970.html