Fireabse UI注册而无需请求用户名 [英] Fireabse UI sign up without requesting user name

查看:68
本文介绍了Fireabse UI注册而无需请求用户名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Firebase UI进行登录和注册,如何删除用户使用&姓?换句话说,只需要输入他们的电子邮件和密码即可.

根据

解决方案

拉请求实现此功能的建议您在EmailBuilder对象上调用 setRequireName(false).

  AuthUI.IdpConfig.EmailBuilder().setRequireName(false).build() 

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(...

解决方案

The pull request that implements this feature suggests that you call setRequireName(false) on your EmailBuilder object.

AuthUI.IdpConfig.EmailBuilder().setRequireName(false).build()

这篇关于Fireabse UI注册而无需请求用户名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆