UIUser is deprecated in iOS 10. Use
UNNotification instead. A
UIUser object encapsulates the types of notifications that can be displayed to the user by your app.
- iOS 8.0–10.0Deprecated
Apps that use visible or audible alerts in conjunction with a local or push notification must register the types of alerts they employ. UIKit correlates the information you provide with the user’s preferences to determine what types of alerts your app is allowed to employ.
Use this class to encapsulate your initial registration request and to view the request results. After creating an instance of this class and specifying your preferred settings, call the
register method of the
UIApplication class to register those settings. After checking your request against the user preferences, the app delivers the results to the
application(_: method of its app delegate. The object passed to that method specifies the types of notifications that your app is allowed to use.
In addition to registering your app’s alert types, you can also use this class to register groups of custom actions to display in conjunction with local or push notifications. Custom actions represent immediate tasks your app can perform in response to the notification. You define groups of actions and associate the entire group with a given notification. When the corresponding alert is displayed, the system adds buttons for each action you specified. When the user taps the button for one of the actions, the system wakes your app and calls the
application(_: method of its app delegate. Use those methods to perform the requested action.