「無聲」推送是不會創建用戶界面的推送通知;他們會告訴您的應用程序獲取或對在線可用的新內容做出反應。
在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];