Instance Method


Called to tell the delegate the types of local and remote notifications that can be used to get the user’s attention.


optional func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings)



The app object that registered the user notification settings.


The user’s specified notification settings for your app. The settings in this object may be different than the ones you originally requested.


Apps that use local or remote notifications to alert the user to new information must register the types of notifications they want to use by calling the registerUserNotificationSettings(_:) method of the app object. The system compares your app’s request with the user’s preferences to determine the types of local and remote notifications allowed, and returns the results to your app by calling this method. Check the contents of the notificationSettings parameter whenever this method is called.

Because the user can change notification settings in the Settings app at any time, call the currentUserNotificationSettings method before your app performs work to prepare a notification for presentation.

The first time you register your app’s preferred notification types, the system asks the user whether your app should be allowed to deliver notifications and stores the user’s response. The system does not prompt the user on subsequent calls to the registerUserNotificationSettings(_:) method, but the user can always change notification preferences using Settings.

A user’s notification settings control only whether the system displays local or remote notifications onscreen. Regardless of the notification settings, local and remote notifications are delivered to your app at the appropriate times.