Creates and returns a settings object that you can use to register your requested notification and action types.
SDKs
- iOS 8.0–10.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
Framework
- UIKit
Declaration
+ (instancetype)settingsForTypes:(UIUser Notification Type)types categories:(NSSet<UIUser Notification Category *> *)categories;
Parameters
allowedUserNotificationTypes
The notification types that your app supports. For a list of possible values, see the constants for the
UIUser
type.Notification Type actionSettings
A set of
UIUser
objects that define the groups of actions a notification may include.Notification Category
Return Value
A new user notification settings object that you can register with the UIApplication
object.
Discussion
Use this method to create a new settings object that you intend to register with the app. When calling this method, specify the types of notifications you intend to deliver to the user such as alerts or sounds. If you intend to display custom actions in your notifications, use this method to register those actions as well.
After creating a new settings object, register that object by calling the register
method of the shared UIApplication
object.