Apple's framework for managing local and remote notifications. UserNotifications provides a unified API for scheduling, displaying, and handling notifications on iOS.
of iOS users worldwide can use UserNotifications (iOS 10+ required)
| iOS Version | Market Share | Status |
|---|---|---|
| iOS 18.7 | 30.3% | Supported |
| iOS 18.6 | 29.8% | Supported |
| iOS 26.1 | 10.7% | Supported |
| iOS 18.5 | 6.0% | Supported |
| iOS 16.7 | 2.3% | Supported |
| iOS 26.2 | 2.0% | Supported |
| iOS 18.3 | 1.8% | Supported |
| iOS 15.8 | 1.8% | Supported |
| iOS 11.0 | 1.7% | Supported |
| iOS 17.6 | 1.7% | Supported |
Local notification scheduling
Remote push notifications
Rich notification content
Notification actions and categories
Notification management center
Custom notification UI
Request authorization to send notifications
import UserNotifications
func requestNotificationPermission() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
if granted {
print("Notification permission granted")
} else if let error = error {
print("Error: \(error.localizedDescription)")
}
}
}Schedule a notification to appear after a delay
import UserNotifications
func scheduleNotification() {
let content = UNMutableNotificationContent()
content.title = "Reminder"
content.body = "Don't forget to check your app!"
content.sound = .default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)
let request = UNNotificationRequest(identifier: "reminder", content: content, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in
if let error = error {
print("Error scheduling notification: \(error)")
}
}
}Apple's framework for managing local and remote notifications. UserNotifications provides a unified API for scheduling, displaying, and handling notifications on iOS.
UserNotifications is available on iOS 10 and later. Currently, 99.7% of iOS users worldwide can use this framework.
Related frameworks include Pushkit. Each has different capabilities and iOS version requirements.