Class

UNNotificationRequest

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

Overview

A UNNotificationRequest object is used to schedule a local notification and manages the content for a delivered notification. A notification request object contains a UNNotificationContent object with the contents of the notification. It also contains the UNNotificationTrigger object that specifies the conditions that trigger the delivery of the notification. For a delivered notification, you use these objects to fetch information about the notification.

To schedule a local notification, create an instance of this class using the init(identifier:content:trigger:) method and pass that instance to the addNotificationRequest: method of the singleton notification center object. When creating the object, you specify the content and trigger conditions to use for your notification.

For a delivered notification, the UNNotification object stores an instance of this class in the request property. Use that instance to retrieve the notification’s content and trigger conditions. To view the list of delivered notifications, call the notification center’s getPendingNotificationRequests(completionHandler:) method.

Topics

Creating a Notification Request

Getting the Request Details

var identifier: String

The unique identifier for this notification request.

var content: UNNotificationContent

The content associated with the notification.

var trigger: UNNotificationTrigger?

The conditions that trigger the delivery of the notification.

Relationships

Inherits From

See Also

Notifications

class UNNotification

The data for a delivered notification.

class UNNotificationResponse

The user’s response to an actionable notification.