“无声”推送是不会创建用户界面的推送通知;他们会告诉您的应用程序获取或对在线可用的新内容做出反应。
在iOS 8中,Apple已分离出UI和推送的权限。推送权限也是默认自动接受的!这意味着您的iOS 8应用将能够更加可靠取决于接收无声的通知中的iOS 8
要迁移应用程序,更改下面的代码的能力:
// iOS的8前:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];
//对于iOS 8:
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];