Firebase身份验证错误android

时间:2016-11-24 07:05:34

标签: android firebase firebase-authentication

我收到的错误如下:

Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/

当我打电话时:

Firebase authenticateUser = new Firebase(ReferenceUrl.FIREBASE_CHAT_URL); // Get app main firebase url
                authenticateUser.authWithPassword(userName, passWord, authResultHandler);

我在Firebase中创建了一个项目,并在app模块中添加了JSON文件并添加了 编译com.google.firebase:firebase-core:9.8.0  图书馆也需要帮助

1 个答案:

答案 0 :(得分:0)

使用以下方法验证firebase登录:

FirebaseAuth.getInstance().signInWithEmailAndPassword(email,password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (task.isSuccessful()) {
                        //display some message here
                        Toast.makeText(Registration.this, "Successfully Signed In", Toast.LENGTH_LONG).show();
                    } else {
                        //display some message here
                        Toast.makeText(Registration.this, "Signed In Error", Toast.LENGTH_LONG).show();
                    }
                }
            });

希望这会对你有所帮助。