注册推送通知

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

 UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
                                                 UIUserNotificationTypeBadge |
                                                 UIUserNotificationTypeSound);
 UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil];
 [application registerUserNotificationSettings:settings];
 [application registerForRemoteNotifications];

 

posted @ 2016-10-27 18:05  我叫南部21号  阅读(143)  评论(0编辑  收藏  举报