Register the application for remote push notifications and handle registration request results.
Click to copy the blue snippets and then paste them into your code.import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let settings = UIUserNotificationSettings(forTypes: [.Badge, .Sound, .Alert], categories: nil) UIApplication.sharedApplication().registerUserNotificationSettings(settings) UIApplication.sharedApplication().registerForRemoteNotifications() return true } func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { // We have our devide push token now. } func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) { // Something went wrong and you better to look into error description. } }