<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UserNotifications",
  "identifier" : "/documentation/UserNotifications/UNUserNotificationCenter/getNotificationCategories(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "User Notifications"
    ],
    "preciseIdentifier" : "c:objc(cs)UNUserNotificationCenter(im)getNotificationCategoriesWithCompletionHandler:"
  },
  "title" : "getNotificationCategories(completionHandler:)"
}
-->

# getNotificationCategories(completionHandler:)

Fetches your app’s registered notification categories.

```
func getNotificationCategories(completionHandler: @escaping @Sendable (Set<UNNotificationCategory>) -> Void)
```

## 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:

- categories: The set of [`UNNotificationCategory`](/documentation/UserNotifications/UNNotificationCategory) objects containing your registered notification types. If your app has not yet registered any categories, this parameter is an empty set.

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func notificationCategories() async -> Set<UNNotificationCategory>
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

Use this method to retrieve your app’s currently registered notification types. You might use this method when you want to augment the current set of categories with new categories later on. Simply merge the returned set with any new category objects and register the updated set.

```swift
let center = UNUserNotificationCenter.current()
let categories = await center.notificationCategories()
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)