title: Method not being called: - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
body: <p>Been stuck on this forever, but could not get the following methods to be called. I am able to get the phone to ask for permission but after that it gets stuck.</p>
  
  <pre><code>- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  {
      NSLog(@"My token is: %@", deviceToken);
  }
  
  - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
  {
      NSLog(@"Failed to get token, error: %@", error);
  }
  </code></pre>
  
  <p>I have tried quite a few things including:</p>
  
  <p>1) everything offered in the following stackoverflow post: <a href="https://stackoverflow.com/questions/4086599/why-didregisterforremotenotificationswithdevicetoken-is-not-called">why didRegisterForRemoteNotificationsWithDeviceToken is not called</a></p>
  
  <p>2) Looking at this technical note from Apple: <a href="https://developer.apple.com/library/ios/technotes/tn2265/_index.html" rel="nofollow noreferrer">https://developer.apple.com/library/ios/technotes/tn2265/_index.html</a></p>
  
  <p>3) This entire tutorial: <a href="http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1" rel="nofollow noreferrer">http://www.raywenderlich.com/32960/apple-push-notification-services-in-ios-6-tutorial-part-1</a> (so hopefully my certificates are all good) </p>
  
  <p>4) (And yes I have internet connection)</p>
  
  <p>Does anyone have any possible solutions? I have been rattling my brains out for the last 2-3 days and have already had to factory reset my phone twice, as well as change the date on my phone N^e number of times in order to get the notification popup to appear to test over and over again. </p>
  
  <p>Would love any help! Thanks!</p>
  
  <p>Here is what I am using to call... (tried a few other versions):</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
      //other stuff not related
  
      if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
      #ifdef __IPHONE_8_0
          UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert) categories:nil];
          [application registerUserNotificationSettings:settings];
          [application registerForRemoteNotifications];
      #endif
      } else {
          UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound;
          [application registerForRemoteNotificationTypes:myTypes];
      }
  
      return YES;
  }
  </code></pre>