title: registerForRemoteNotificationTypes not working iOS7 xcode 6
body: <p>I have an issue after upgrading our app to work with iOS 8, where registerForRemoteNotificationTypes does not appear to be working on phone running iOS 7, as in didRegisterForRemoteNotificationsWithDeviceToken does not get called and the "Allow Push Notifications" dialog is not appearing on the app. This is the code I am using</p>
  
  <pre><code>// Add registration for remote notifications
  if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
      NSLog(@"iOS 8 Registering for remote notification");
      UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
      [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
      [[UIApplication sharedApplication] registerForRemoteNotifications];
  } else {
      NSLog(@"Registering for remote notification");
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
  }
  </code></pre>
  
  <p>This code works fine for phones running iOS 8, just not iOS 7.
  One other bit of information we managed to get push notifications to work on an iOS 7 phone only after running the app through xcode with the phone attached. We then deployed the same code as an ad Hoc deployment to another iPhone and iPad running iOS 7 and neither worked.
  Is there something obvious I am missing here.</p>