TechnologiesApp Extensions & System Integration

UserNotifications

iOSmacOStvOSwatchOSvisionOS

UserNotifications lets you schedule, deliver, and handle local and remote user notifications, including their content, actions, attachments, and triggers. You compose a notification with UNMutableNotificationContent, attach media through UNNotificationAttachment, and choose when it fires using a UNNotificationTrigger such as UNTimeIntervalNotificationTrigger, UNCalendarNotificationTrigger, or UNPushNotificationTrigger, then submit it as a UNNotificationRequest to the UNUserNotificationCenter. Request authorization with UNAuthorizationOptions, define interactive UNNotificationAction and UNNotificationCategory groupings, and respond to delivered notifications and user input through UNUserNotificationCenterDelegate, UNNotificationResponse, and UNTextInputNotificationResponse. With UNNotificationServiceExtension you can modify the content of incoming remote notifications before they are presented.

Notification Center 2

The central object for requesting authorization and scheduling, managing, and responding to notifications.

  • Cl
    UNUserNotificationCenteriOS 10.0+
    The central object for managing notification activities, including authorization, scheduling, and delivery.
  • Pr
    UNUserNotificationCenterDelegateiOS 10.0+
    An interface for handling incoming notifications and the user's responses to them.

Notification Content 7

Types that describe the payload, sound, and media of a notification.

  • Cl
    UNNotificationContentiOS 10.0+
    The read-only data, such as title, body, and badge, associated with a notification.
  • Cl
    UNMutableNotificationContentiOS 10.0+
    The editable content you compose when scheduling a local notification.
  • Pr
    UNNotificationContentProvidingiOS 15.0+
    A protocol adopted by types that provide content for a notification.
  • Cl
    UNNotificationAttachmentiOS 10.0+
    An object representing media, such as an image, sound, or video, attached to a notification.
  • Cl
    UNNotificationSoundiOS 10.0+
    An object representing the sound played when a notification is delivered.
  • St
    UNNotificationSoundName
    A structure that identifies a notification sound by name.
  • Cl
    UNNotificationAttributedMessageContextiOS 18.0+
    An object that provides attributed message context for displaying a communication notification.

Notification Requests 2

Types that bundle content with a trigger and represent scheduled and delivered notifications.

  • Cl
    UNNotificationRequestiOS 10.0+
    A request to schedule a local notification, pairing notification content with a delivery trigger.
  • Cl
    UNNotificationiOS 10.0+
    An object that represents a notification that has been delivered to the user.

Triggers 4

Conditions that determine when a notification is delivered.

  • Cl
    UNNotificationTriggeriOS 10.0+
    The abstract base class for conditions that cause a notification to be delivered.
  • Cl
    UNTimeIntervalNotificationTriggeriOS 10.0+
    A trigger that delivers a notification after a specified time interval elapses.
  • Cl
    UNCalendarNotificationTriggeriOS 10.0+
    A trigger that delivers a notification at a specified date and time.
  • Cl
    UNPushNotificationTriggeriOS 10.0+
    A trigger indicating that a notification was delivered through Apple Push Notification service.

Actions and Categories 6

Interactive buttons and groupings that let users respond to a notification.

  • Cl
    UNNotificationActioniOS 10.0+
    An object that describes a button the user can tap to respond to a delivered notification.
  • Cl
    UNTextInputNotificationActioniOS 10.0+
    An action that accepts text input from the user when responding to a notification.
  • Cl
    UNNotificationActionIconiOS 15.0+
    An object that defines the icon displayed alongside a notification action.
  • Cl
    UNNotificationCategoryiOS 10.0+
    An object that defines a type of notification along with the actions the user can take in response.
  • St
    UNNotificationActionOptionsiOS 10.0+
    Options that configure the behavior of a notification action.
  • St
    UNNotificationCategoryOptionsiOS 10.0+
    Options that configure the behavior of a notification category.

Responses 2

Types that capture how a user interacted with a delivered notification.

  • Cl
    UNNotificationResponseiOS 10.0+
    An object describing the user's response to a delivered notification.
  • Cl
    UNTextInputNotificationResponseiOS 10.0+
    A response that contains the text the user entered when replying to a notification.

Service Extension 1

Support for modifying the content of incoming remote notifications before they are presented.

  • Cl
    UNNotificationServiceExtensioniOS 10.0+
    An object that modifies the content of a remote notification before it is delivered to the user.

Authorization and Settings 8

Types that describe a user's notification preferences and the permissions your app has been granted.

  • Cl
    UNNotificationSettingsiOS 10.0+
    An object reporting the notification-related settings and authorization status for your app.
  • St
    UNAuthorizationOptionsiOS 10.0+
    Options that specify the notification interactions your app requests authorization to use.
  • En
    UNAuthorizationStatusiOS 10.0+
    Constants that indicate whether the user has authorized your app to deliver notifications.
  • En
    UNNotificationSettingiOS 10.0+
    Constants that indicate whether a specific notification feature is enabled, disabled, or unsupported.
  • St
    UNNotificationPresentationOptionsiOS 10.0+
    Options that determine how a notification is presented while the app is in the foreground.
  • En
    UNNotificationInterruptionLeveliOS 15.0+
    Constants that indicate the importance and delivery timing of a notification.
  • En
    UNAlertStyleiOS 10.0+
    Constants that indicate the style used to present alert-based notifications.
  • En
    UNShowPreviewsSettingiOS 11.0+
    Constants that indicate when the system shows notification content previews.

Errors 1

The error type reported by UserNotifications operations.

  • St
    UNErroriOS 10.0+
    An error type describing failures encountered while working with notifications.

Extends 1

NSString
← App Extensions & System Integration