getUserByPhoneNumber method

Future<UserRecord> getUserByPhoneNumber(
  1. String phoneNumber
)
inherited

Gets the user data for the user corresponding to a given phone number. The phone number has to conform to the E.164 specification.

See https://firebase.google.com/docs/auth/admin/manage-users#retrieve_user_data for code samples and detailed documentation.

Takes the phone number corresponding to the user whose data to fetch.

Returns a Future fulfilled with the user data corresponding to the provided phone number.

Implementation

Future<UserRecord> getUserByPhoneNumber(String phoneNumber) async {
  final response =
      await _authRequestHandler.getAccountInfoByPhoneNumber(phoneNumber);
  // Returns the user record populated with server response.
  return UserRecord.fromResponse(response);
}