The object for managing notification-related settings and the authorization status of your app
- iOS 10.0+
- tvOS 10.0+
- watchOS 3.0+
UNNotification object contains information about the current notification-related settings and authorization status for your app. Apps must request authorization before they can schedule notifications that involve user interactions such as displaying alerts, playing sounds, or badging the app’s icon. Even after authorization is granted, apps should check their authorization status at launch time in case the user revised the types of interactions that are allowed.
You do not create instances of this class directly. To retrieve the settings for your app, call the
get method of your app’s
UNUser object. You can use the information in the returned object to determine your app’s behaviors. For example, if sounds are not permitted, you should avoid specifying sounds when scheduling local notifications. Even if you do not alter the interactions you include in your notification contents, the system enforces the settings by preventing denied interactions from occurring.
For more information about requesting authorization for user interactions, see