Contents

getPhoneNumberState(forSuffix:completion:)

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

Declaration

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

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