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
  • 42,757
  • 9
  • 93
  • 110
77base
  • 59
  • 6
  • possible duplicate of [iOS 8 enabled device not receiving PUSH notifications after code update](http://stackoverflow.com/questions/25909568/ios-8-enabled-device-not-receiving-push-notifications-after-code-update) – CRDave Nov 05 '14 at 11:08

1 Answers1

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)];
    }

}
DaSilva
  • 1,358
  • 1
  • 19
  • 42