检查给定的电子邮件是否存在 [英] Check if given email exists

查看:26
本文介绍了检查给定的电子邮件是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法知道用户输入的电子邮件在 Firebase 中是否真实?内置的用email&password方式注册有这个功能吗?

Is there a way to know if the email entered by user is real in Firebase? Does the built-in sign up with email&password method have this feature?

抱歉造成误解.我不在乎之前是否使用过该电子邮件,我需要知道的是:输入的电子邮件是编造"还是真实存在"

sorry for the misunderstanding . I don't care if the email has been used before , what I need to know is: if the entered email is 'made-up' or 'real , exists'

推荐答案

这是另一种没有任何创建用户或登录过程的解决方案.

This is another solution without any create user or sign in processes.

//check email already exist or not.
    firebaseAuth.fetchSignInMethodsForEmail(email)
            .addOnCompleteListener(new OnCompleteListener<SignInMethodQueryResult>() {
                @Override
                public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {

                    boolean isNewUser = task.getResult().getSignInMethods().isEmpty();

                    if (isNewUser) {
                        Log.e("TAG", "Is New User!");
                    } else {
                        Log.e("TAG", "Is Old User!");
                    }

                }
            });

这篇关于检查给定的电子邮件是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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