---
title: "userIdentity(forPhoneNumber:)"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/ckcontainer/useridentity(forphonenumber:)"
---

# userIdentity(forPhoneNumber:)

Fetches the user identity for the specified phone number.

## Declaration

```swift
func userIdentity(forPhoneNumber phoneNumber: String) async throws -> CKUserIdentity?
```

## Parameters

- `phoneNumber`: The user’s phone number.

## Return Value

Return Value The user identity for the phone number.

## Discussion

Discussion Use this method to retrieve the identity of a user who the current user knows. The user you’re searching for must meet the following criteria: The user has run the app. The user grants the userDiscoverability permission for the container. This method searches for the user asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of CKDiscoverUserIdentitiesOperation and configure it to use the necessary priority.
