Код: Выделить всё
if (deviceToken == nil) {
print("There is no deviceToken saved yet.")
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().registerForRemoteNotifications()
}
Подробнее здесь: https://stackoverflow.com/questions/336 ... pp-is-open