问题
Using Firebase UI for sign-in and sign-up, how do I remove the option for a user to sign-up with a first & last name? In other words, only their email and password are required.
According to this github issue, the feature to do so has been implemented.
Firebase provided Kotlin code for sign-in/sign-up:
private fun createSignInIntent() {
// Choose authentication providers
val providers = arrayListOf(
AuthUI.IdpConfig.EmailBuilder().build(),
AuthUI.IdpConfig.GoogleBuilder().build())
// Create and launch sign-in intent
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.setLogo(R.drawable.logo)
.setTheme(R.style.AppTheme)
.build(),
RC_SIGN_IN)
}
override fun onActivityResult(...
回答1:
The pull request that implements this feature suggests that you call setRequireName(false)
on your EmailBuilder object.
AuthUI.IdpConfig.EmailBuilder().setRequireName(false).build()
来源:https://stackoverflow.com/questions/62135803/fireabse-ui-sign-up-without-requesting-user-name