Constants indicating how to present a notification in a foreground app.


struct UNNotificationPresentationOptions



static var badge: UNNotificationPresentationOptions

Apply the notification's badge value to the app’s icon.

static var sound: UNNotificationPresentationOptions

Play the sound associated with the notification.

static var alert: UNNotificationPresentationOptions

Display the alert using the content provided by the notification.


Conforms To

See Also

Receiving Notifications

func userNotificationCenter(UNUserNotificationCenter, willPresent: UNNotification, withCompletionHandler: (UNNotificationPresentationOptions) -> Void)

Asks the delegate how to handle a notification that arrived while the app was running in the foreground.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software