What is push Notification method for iOS 8?

What's the new Push Notification method in iOS 8?

I use this method but it doesn't work.

 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlertUIRemoteNotificationTypeBadgeUIRemoteNotificationTypeSound];

      

Can anyone help me?

+3


source to share


1 answer


Quiet clicks are push notifications that do not create a user experience; they instead tell your application to receive or respond to new content available on the Internet.

In iOS 8, Apple allocated permissions to the UI and clicked. The push permission is also automatically accepted by default! This means that your iOS 8 apps will be able to depend much more reliably on being able to receive silent notifications in iOS 8.

To migrate your application, change the following code:

// Before iOS 8:



 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound];

      

// For iOS 8:

 UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];

 [[UIApplication sharedApplication] registerUserNotificationSettings:settings];
 [[UIApplication sharedApplication] registerForRemoteNotifications];

      

+2


source







All Articles