title: Device Token not received when registering for remote notifications in Swift
body: <p>I somehow can not receive the device token when registering for remote notifications. I get the modal saying "Do you want to allow App X to be able to send you notificaitons", but when I accept it, the didRegisterForRemoteNotifications function is not called.  </p>
  
  <p>When I register for remote notifications in iOS 8/Swift using this code: </p>
  
  <pre><code>    UIApplication.sharedApplication().registerForRemoteNotifications()
      let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Badge | UIUserNotificationType.Alert | UIUserNotificationType.Sound, categories: nil)
      UIApplication.sharedApplication().registerUserNotificationSettings(settings)
      UIApplication.sharedApplication().registerForRemoteNotifications()
  </code></pre>
  
  <p>These functions are not triggered at all: </p>
  
  <pre><code>   func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData!) 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>func application(application: UIApplication,    didFailToRegisterForRemoteNotificationsWithError error: NSError!) 
  </code></pre>
  
  <p>however when I log this </p>
  
  <pre><code>println("current settings \(UIApplication.sharedApplication().currentUserNotificationSettings()) and \(UIApplication.sharedApplication().isRegisteredForRemoteNotifications())")
  </code></pre>
  
  <p>I receive </p>
  
  <pre><code>"current settings &lt;UIUserNotificationSettings: 0x170437120; types: (UIUserNotificationTypeAlert UIUserNotificationTypeBadge UIUserNotificationTypeSound);&gt; and true" 
  </code></pre>
  
  <p>My provisioning profile and certificates ar all in order. </p>
  
  <p>Has someone else had this problem? </p>