Sim*_*ner 8 android firebase firebase-authentication
我的问题:
我制作了一个小型Android应用程序,您可以在其中注册并使用firebase auth系统登录.我做到了:
private FirebaseAuth firebaseAuth;
firebaseAuth = FirebaseAuth.getInstance()Run Code Online (Sandbox Code Playgroud)
然后我使用了firebaseAuth.signinwithEmailAndPassword.现在我的问题是:我可以从用户的电子邮件帐户中获取名字和姓氏吗?喜欢在youtube上的评论:示例:
名字姓:好视频
这不是电子邮件地址,而是名字和姓氏,问候
您可以从用户的个人资料中获取用户的姓名。从Firebase 文档中读取用户配置文件:
要获取用户的配置文件信息,请使用 实例的访问器方法
FirebaseUser。例如:Run Code Online (Sandbox Code Playgroud)FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user != null) { // Name, email address, and profile photo Url String name = user.getDisplayName(); String email = user.getEmail(); Uri photoUrl = user.getPhotoUrl(); // Check if user's email is verified boolean emailVerified = user.isEmailVerified(); // The user's ID, unique to the Firebase project. Do NOT use this value to // authenticate with your backend server, if you have one. Use // FirebaseUser.getToken() instead. String uid = user.getUid(); }
| 归档时间: |
|
| 查看次数: |
3917 次 |
| 最近记录: |