1
if([application respondsToSelector:@selector(registerUserNotificationSettings:)]) { 
 [self registerForiOS8PushSettings]; //for iOS8 
 } else {
//iOS7 or earlier
 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
 }

Unable to get the push notification to iOS7 device. didRegisterForRemoteNotificatiosnWithDeviceToken get called, In fact Message is successfully delivered. Working fine in iOS8.

Anil Varghese
43k9 gold badges96 silver badges110 bronze badges
asked Nov 5, 2014 at 10:59
1

1 Answer 1

1

With the iOS8 the process had change. To make your app register for iOS8 and early versions make something like this:

-(void)registerAppForNotifications{
 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
 {
 [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
 [[UIApplication sharedApplication] registerForRemoteNotifications];
 }
 else
 {
 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeNewsstandContentAvailability| UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
 }
}
answered Nov 5, 2014 at 11:18
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.