[英]User info not loading into firebase auth
I am trying to create a very simple login with Facebook using firebase and android studio. 我正在尝试使用firebase和android studio在Facebook上创建一个非常简单的登录。 My login with Facebook works and I was able to run the app and sign in but none of my info has been stored in firebase (I want to have the persons name, email, etc.) I know it's something small I am probably missing but I cannot figure it out and I have tried so many things.
我的Facebook登录工作,我能够运行应用程序并登录,但我的信息都没有存储在firebase中(我想要人员姓名,电子邮件等)我知道这是我可能遗失的小事但是我无法理解,我尝试了很多东西。 Also I checked and all my gradle files are up to date and my firebase is set up correctly so it has nothing to do with that.
此外,我检查了所有我的gradle文件是最新的,我的firebase设置正确,所以它与此无关。 plz help.
请帮助。
firebaseAuth = FirebaseAuth.getInstance();
firebaseAuthListner = new FirebaseAuth.AuthStateListener(){
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if(user != null){
// what do i put here to pull out the fb users info into firebase?!
goMainScreen();
}
}
};
I have tried: 我努力了:
if(user != null){
String name = user.getDisplayName();
String email = user.getEmail();
String uid = user.getUid();
I have tried: 我努力了:
if (user != null) {
// User is signed in
Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
} else {
// User is signed out
Log.d(TAG, "onAuthStateChanged:signed_out");
}
I know it is probably a dumb mistake because I am new to firebase and android studio but any advice will help. 我知道这可能是一个愚蠢的错误,因为我是firebase和android studio的新手,但任何建议都会有所帮助。 Thank you
谢谢
Are your user stored into the firebase console? 您的用户是否存储在firebase控制台中? ( https://console.firebase.google.com )
( https://console.firebase.google.com )
If it is not stored in your project, it will not return anything when you call the getDisplayName(), getUser(), etc. 如果它没有存储在你的项目中,当你调用getDisplayName(),getUser()等时它不会返回任何内容。
If they are stored, please post the complete code that you are using to do the login. 如果存储它们,请发布您用于登录的完整代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.