I want to add users to Firebase with usernames,p passwords, and emails. I'm using the Email-Password sign-in method but how can I add the username to the database? Here is the basic code that I wrote for the email&password sign-in method:
fun signup(view:View){
val email = binding.emailText.text.toString()
val username = binding.usernameText2.text.toString()
val password = binding.passwordText2.text.toString()
if(email.equals("") || username.equals("") || password.equals("")){
Toast.makeText(this,"Don't Leave them empty!",Toast.LENGTH_LONG).show()
}else{
auth.createUserWithEmailAndPassword(email,password).addOnSuccessListener {
//sucess
val intent = Intent(this@SignupActivity,FeedsActivity::class.java)
startActivity(intent)
finish()
}.addOnFailureListener {
//failed
Toast.makeText(this,it.localizedMessage,Toast.LENGTH_LONG).show()
}
}
}