It may be a question in advance but I wonder what to use instead of UILocalNotification
in iOS 10. I am working on an app which has deployment target iOS 8 so w
Apple have done it again, the correct implementation is: AppDelegate.swift
if #available(iOS 10.0, *) {
let center = UNUserNotificationCenter.currentNotificationCenter()
center.requestAuthorizationWithOptions([.Alert, .Sound]) { (granted, error) in
// Enable or disable features based on authorization.
}
} else {
// Fallback on earlier versions
}
and don't forget to add
import UserNotifications