Instance Method

getNotificationSettingsWithCompletionHandler:

Requests the notification settings for this app.

Declaration

- (void)getNotificationSettingsWithCompletionHandler:(void (^)(UNNotificationSettings *settings))completionHandler;

Parameters

completionHandler

The block to execute asynchronously with the results. This block may be executed on a background thread. The block has no return value and takes the following parameter:

settings

The UNNotificationSettings object containing the current authorization settings for your app.

Discussion

Use this method to determine the user interactions and notification-related features that your app is authorized to use. You might then use this information to enable or disable specific notification-related features of your app.

When the user initially grants authorization to your app, the system gives your app a set of default notification-related settings. The user may change those settings at any time to enable or disable specific capabilities. For example, the user might disable the playing of sounds when a notification arrives.

See Also

Managing Settings and Authorization

- requestAuthorizationWithOptions:completionHandler:

Requests authorization to interact with the user when local and remote notifications are delivered to the user’s device.

supportsContentExtensions

A Boolean value indicating whether the current device supports notification content extensions.

UNAuthorizationOptions

Constants for requesting authorization to interact with the user.