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\",
Please make sure your certificates are valid and app is registered successfully,Do some Googling and u will sure find right way.This code worked for me.
(in AppDelegate.swift didFinishLaunchingWithOptions method )
var notify : UIUserNotificationSettings = UIUserNotificationSettings(forTypes:UIUserNotificationType.Alert|UIUserNotificationType.Sound, categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(notify)
UIApplication.sharedApplication().registerForRemoteNotifications()
// Add Delegate methods of UIApplication
func application(application: UIApplication,didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData){
//send this device token to server
println("\(deviceToken)")
}
//Called if unable to register for APNS.
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
println(error)
}