---
title: "getPhoneNumberState(forSuffix:completion:)"
framework: coretelephony
role: symbol
role_heading: Instance Method
path: "coretelephony/ctquickswitchmanager/getphonenumberstate(forsuffix:completion:)"
---

# getPhoneNumberState(forSuffix:completion:)

Queries the quick switch state for a phone number whose suffix matches the provided phone number suffix.

## Declaration

```swift
func getPhoneNumberState(forSuffix phoneNumberSuffix: String, completion completionHandler: @escaping @Sendable (CTQuickSwitchState, (any Error)?) -> Void)
```

```swift
func phoneNumberState(forSuffix phoneNumberSuffix: String) async throws -> CTQuickSwitchState
```

## Discussion

Discussion Parameters phoneNumberSuffix: The last 4 digits of the phone number to check. The framework presents a person with a consent screen to provide this information to the requesting app. If a person denies consent, the app returns CTQuickSwitchState.notEnrolled and no error value. completionHandler: A completion handler the framework calls after processing the request. The parameters the framework passes to the completion handler indicate the CTQuickSwitchState and an error value that indicates whether the request succeeded, failed, or ended in an unknown state. Discussion The framework presents a person with a consent screen to provide this information to the requesting app. If someone denies consent, the app returns CTQuickSwitchState.notEnrolled and no error.

## See Also

### Checking the state of a device

- [getDeviceState(_:)](coretelephony/ctquickswitchmanager/getdevicestate(_:).md)
- [CTQuickSwitchState](coretelephony/ctquickswitchstate.md)
