---
title: "discoverAllIdentities(completionHandler:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckcontainer/discoverallidentities(completionhandler:)"
---

# discoverAllIdentities(completionHandler:)

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

## Declaration

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

## Parameters

- `completionHandler`: The handler to execute with the fetch results.

## Discussion

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 and configure it to use the necessary priority.

## See Also

### Discovering User Records

- [discoverUserIdentity(withEmailAddress:completionHandler:)](cloudkit/ckcontainer/discoveruseridentity(withemailaddress:completionhandler:).md)
- [discoverUserIdentity(withPhoneNumber:completionHandler:)](cloudkit/ckcontainer/discoveruseridentity(withphonenumber:completionhandler:).md)
- [discoverUserIdentity(withUserRecordID:completionHandler:)](cloudkit/ckcontainer/discoveruseridentity(withuserrecordid:completionhandler:).md)
- [fetchShareParticipant(withEmailAddress:completionHandler:)](cloudkit/ckcontainer/fetchshareparticipant(withemailaddress:completionhandler:).md)
- [fetchShareParticipant(withPhoneNumber:completionHandler:)](cloudkit/ckcontainer/fetchshareparticipant(withphonenumber:completionhandler:).md)
- [fetchShareParticipant(withUserRecordID:completionHandler:)](cloudkit/ckcontainer/fetchshareparticipant(withuserrecordid:completionhandler:).md)
- [fetchUserRecordID(completionHandler:)](cloudkit/ckcontainer/fetchuserrecordid(completionhandler:).md)
- [CKCurrentUserDefaultName](cloudkit/ckcurrentuserdefaultname.md)
- [CKOwnerDefaultName](cloudkit/ckownerdefaultname.md)
