title: Why isn't this device token being printed to the NSLog?
body: <p>I am trying to print a device token to the Debugger Window. When building and running the app on a test device, the app receives a <code>Would Like to Send You Push Notifications</code> alert, but the NSLog doesn't print the device token.</p>
  <pre><code>//REGISTER FOR THE NOTIFICATIONS TYPES
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
  {
  
  //-- Set Notification
  if (@available(iOS 8, *)) {
    // iOS 8 Notifications: Registering for notifications and types
      [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
  
      [application registerForRemoteNotifications];
  } else {
  // iOS &lt; 8 Notifications
      _storyBoard = [UIStoryboard storyboardWithName:@&quot;MainStoryboard&quot; bundle:nil];
  
      [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
  
       (UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
  }
  
  if (launchOptions != nil)
  {
      NSDictionary* dictionary = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
      if (dictionary != nil)
      {
          NSLog(@&quot;Launched from push notification: %@&quot;, dictionary);
          /*[self addMessageFromRemoteNotification:dictionary updateUI:NO];*/
      }
  }
  
  return YES;
  }
  
  - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
  {
  NSLog(@&quot;My token is: %@&quot;, deviceToken);
  }
  
  - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
  {
  NSLog(@&quot;Failed to get token, error: %@&quot;, error);
  }
  </code></pre>
  <p><code>didFailToRegisterForRemoteNotificationsWithError</code> isn't being called or printed either. How can this code be edited to print the device token in the NSLog?</p>