private void BtnLogin_Click(object sender, EventArgs e) { if (type == Type.Email) { string email = edtAccount.Text.ToString().Trim(); string password = edtPassword.Text.ToString().Trim(); string verifyCode = edtVerifyCode.Text.ToString().Trim(); IAGConnectAuthCredential credential; if (TextUtils.IsEmpty(verifyCode)) { credential = EmailAuthProvider.CredentialWithPassword(email, password); } else { credential = EmailAuthProvider.CredentialWithVerifyCode(email, password, verifyCode); } SignIn(credential); } else { string countryCode = edtCountryCode.Text.ToString().Trim(); string phoneNumber = edtAccount.Text.ToString().Trim(); string password = edtPassword.Text.ToString().Trim(); string verifyCode = edtVerifyCode.Text.ToString().Trim(); IAGConnectAuthCredential credential; if (TextUtils.IsEmpty(verifyCode)) { credential = PhoneAuthProvider.CredentialWithPassword(countryCode, phoneNumber, password); } else { credential = PhoneAuthProvider.CredentialWithVerifyCode(countryCode, phoneNumber, password, verifyCode); } SignIn(credential); } }