<!--
{
  "availability" : [
    "iOS: 10.0.0 - 17.0.0",
    "iPadOS: 10.0.0 - 17.0.0",
    "macCatalyst: 13.1.0 - 17.0.0",
    "macOS: 10.12.0 - 14.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 3.0.0 - 10.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKContainer/discoverAllIdentities(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKContainer(im)discoverAllIdentitiesWithCompletionHandler:"
  },
  "title" : "discoverAllIdentities(completionHandler:)"
}
-->

# discoverAllIdentities(completionHandler:)

Fetches all user identities that match entries in the user’s Contacts.

```
func discoverAllIdentities(completionHandler: @escaping @Sendable ([CKUserIdentity]?, (any Error)?) -> Void)
```

## Parameters

`completionHandler`

The handler to execute with the fetch results.

## Discussion

The closure doesn’t return a value and takes the following parameters:

- The user identities that match entries in the user’s Contacts.
- An error if a problem occurs, or `nil` if the system successfully completes the request.

This method searches for the users asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of [`CKDiscoverAllUserIdentitiesOperation`](/documentation/CloudKit/CKDiscoverAllUserIdentitiesOperation) and configure it to use the necessary priority.

---

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)