Created
February 4, 2021 08:23
-
-
Save wajahatkarim3/ae5d11e7ceb340f1b0504cf132f1a445 to your computer and use it in GitHub Desktop.
Creating CometUser from Firebase User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var auth = FirebaseAuth.getInstance() | |
auth.createUserWithEmailAndPassword(bi.txtEmail.text.toString(), bi.txtPassword.text.toString()) | |
.addOnCompleteListener { task -> | |
if (task.isSuccessful) { | |
var firebaseUser = auth.currentUser | |
createAndLoginCometUser(firebaseUser!!.uid, bi.txtName.text.toString(), bi.radioDoctor.isChecked) | |
} else { | |
Snackbar.make(bi.root, "Authentication failed!", Snackbar.LENGTH_SHORT).show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment