Framework

UserNotifications

Overview

The UserNotifications framework (UserNotifications.framework) supports the delivery and handling of local and remote notifications. You use the classes of this framework to schedule the delivery of local notifications based on specific conditions, such as time or location. Apps and extensions also use this framework to receive and potentially modify local and remote notifications when they are delivered to the user’s device.

Topics

First Steps

class UNUserNotificationCenter

The central object for managing notification-related activities for your app or app extension.

protocol UNUserNotificationCenterDelegate

The interface for handling notification-related interactions in your app or app extension.

class UNNotificationSettings

The object for managing notification-related settings and the authorization status of your app

Notifications

Request the delivery of a local notification and receive a response associated with a delivered notification.

class UNNotificationRequest

An object you use to specify a notification’s content and the condition that triggers its delivery.

class UNNotification

The data for a delivered notification.

class UNNotificationResponse

The user’s response to an actionable notification.

Notification Content

class UNMutableNotificationContent

The editable content for a notification.

class UNNotificationContent

The uneditable content of a local or remote notification.

class UNNotificationAttachment

A media file associated with a notification.

class UNNotificationSound

A sound to be played when a notification is delivered.

Categories and Actions

Define the actions to display with a notification using categories.

class UNNotificationCategory

A definition of a type of notification that your app supports and the custom actions to display with it.

class UNNotificationAction

A task to perform in response to a delivered notification.

class UNTextInputNotificationAction

An action that can accept user-specified text.

class UNTextInputNotificationResponse

The user’s response to an actionable notification, including any custom text that the user typed or dictated.

Triggers

Define the trigger conditions for delivering local notifications. Detect when a notification was delivered from Apple Push Notification Service.

class UNCalendarNotificationTrigger

The date and time at which to deliver a local notification.

class UNTimeIntervalNotificationTrigger

The time that must expire before the delivery of a local notification.

class UNLocationNotificationTrigger

The geographic location that the user must reach to enable the delivery of a local notification.

class UNPushNotificationTrigger

An object that indicates that a notification was sent from the Apple Push Notification Service.

class UNNotificationTrigger

The common behavior for subclasses that trigger the delivery of a notification.

Service Extension

Modify notifications before they are delivered to your app using a Notification Service app extension.

class UNNotificationServiceExtension

An object that modifies the content of a remote notification before it is delivered to the user.