alertSetting
The authorization status for displaying alerts.
Declaration
var alertSetting: UNNotificationSetting { get }Discussion
When the value of this property is UNNotificationSetting.enabled, the app is authorized to display alerts. Authorization does not guarantee that alerts always appear on the user’s screen. When a device is unlocked, the alertStyle property determines the presentation style for the alert, which can include not displaying the alert at all.
The system tries to display an alert when the title, subtitle, or body properties of a UNNotificationContent object contain values, or when the aps dictionary in a remote notification contains the alert key.