createUser

suspend fun FirebaseAuth.createUser(    name: String,     email: String,     password: String,     profilePhotoUri: Uri?): FirebaseUser

This extension method is used for creating a FirebaseUser with the provided name,email,password and profilePhotoUri.

Firebase doesn't provide a default method to create a user along with a display name and profile photo.In order to perform such a task we need to chain two methods - FirebaseAuth.createUserWithEmailAndPassword and FirebaseAuth.updateCurrentUser.

Throws

com.google.firebase.auth.FirebaseAuthWeakPasswordException

thrown if the password is not strong enough

com.google.firebase.auth.FirebaseAuthInvalidCredentialsException

thrown if the email address is malformed

com.google.firebase.auth.FirebaseAuthUserCollisionException

thrown if there already exists an account with the given email address

com.google.firebase.auth.FirebaseAuthInvalidUserException

thrown if the current user's account has been disabled, deleted, or its credentials are no longer valid.