Class

UNNotificationSettings

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

Declaration

@interface UNNotificationSettings : NSObject

Overview

A UNNotificationSettings object contains the current authorization status and notification-related settings for your app. Apps must receive authorization to schedule notifications and to interact with the user. Apps that run in CarPlay must similarly receive authorization to do so. You use this object to determine what notification-related actions your app is allowed to perform. You might then use that information to enable, disable, or adjust your app's notification-related behaviors. Regardless of whether you take action, the system enforces your app's settings by preventing denied interactions from occurring.

You don't create instances of this class directly. Instead, call the getNotificationSettingsWithCompletionHandler: method of your app’s UNUserNotificationCenter object to get the current settings.

For more information about requesting authorization for user interactions, see UNUserNotificationCenter.

Topics

Getting the Authorization Status

authorizationStatus

The app's ability to schedule and receive local and remote notifications.

UNAuthorizationStatus

Constants indicating whether the app is allowed to schedule notifications.

Getting Device-Specific Settings

notificationCenterSetting

The setting that indicates whether your app’s notifications are displayed in Notification Center.

lockScreenSetting

The setting that indicates whether your app’s notifications appear onscreen when the device is locked.

carPlaySetting

The setting that indicates whether your app’s notifications may be displayed in a CarPlay environment.

alertSetting

The authorization status for displaying alerts.

badgeSetting

The authorization status for badging your app’s icon.

soundSetting

The authorization status for playing sounds for incoming notifications.

criticalAlertSetting

The authorization status to play sounds for critical alerts.

UNNotificationSetting

Constants indicating the current status of a notification setting.

Getting Interface Settings

alertStyle

The type of alert that the app may display when the device is unlocked.

UNAlertStyle

Constants indicating the presentation styles for alerts.

showPreviewsSetting

The setting that indicates whether the app shows a preview of the notification's content.

UNShowPreviewsSetting

Constants indicating the style previewing a notification's content.

providesAppNotificationSettings

A Boolean value indicating the system displays a button for in-app notification settings.

Instance Properties

Relationships

Inherits From

See Also

Notification Management

UNUserNotificationCenter

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

UNUserNotificationCenterDelegate

The interface for handling incoming notifications and notification-related actions.