Package-level declarations

Phone number formatting and validation on top of Google libphonenumber (PhoneNumberFormatter, PhoneNumberValidator), and the optional, host-implemented verification flow (PhoneNumberVerificationHandler, PhoneVerificationController, PhoneVerificationState).

Phone number formatting and validation on top of Google libphonenumber (PhoneNumberFormatter, PhoneNumberValidator), and the optional, host-implemented verification flow (PhoneNumberVerificationHandler, PhoneVerificationController, PhoneVerificationState).

Types

Link copied to clipboard

Formatting and normalization for phone numbers, backed entirely by Google libphonenumber — the Java library on Android, its Objective-C port libPhoneNumber-iOS on iOS, both generated from the same metadata release (see PhoneNumberBackend).

Link copied to clipboard

Country-aware phone validation on top of libphonenumber.

Link copied to clipboard

The contract a host implements to verify a phone number with its own backend.

Link copied to clipboard
class PhoneVerificationController(handler: PhoneNumberVerificationHandler, currentTimeMillis: () -> Long = ::currentEpochMillis)

Sequences PhoneNumberVerificationHandler calls and exposes the result as a single observable PhoneVerificationState.

Link copied to clipboard

Where a phone number is in the verification flow.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun PhoneNumberFormatter.parse(nationalNumber: String, country: Country): Phonenumber.PhoneNumber?

Parses nationalNumber as a number in country into libphonenumber's own Phonenumber.PhoneNumber, returning null when it cannot be parsed at all (rather than throwing into composition).