Попытки работать с Firebase для регистрации удаленных уведомлений, однако при выполнении следующего кода я получаю сообщение об ошибке:Использования UNUserNotificationCenter для прошивки 10
UNUserNotificationCenter is only available on iOS 10.0 or newer
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var soundID: SystemSoundID = 0
let soundFile: String = NSBundle.mainBundle().pathForResource("symphony", ofType: "wav")!
let soundURL: NSURL = NSURL(fileURLWithPath: soundFile)
AudioServicesCreateSystemSoundID(soundURL, &soundID)
AudioServicesPlayAlertSound(soundID)
Fabric.with([Twitter.self])
//Firebase configuration
FIRApp.configure()
//Resource code from stackoverflow to create UNUserNotificationCenter
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in
// Enable or disable features based on authorization.
}
application.registerForRemoteNotifications()
return true
}
Делая простой «Fix-It» Безразлично» t решить мою проблему, создав оператор if на основе номера версии ОС. Что я должен делать или думать об этом решении для платформы UserNotifications?