[英]How do I add name and email to a Firebase user account during signup with phone number?
In the Firebase docs it describes how to create an account using phone number sign up .在 Firebase 文档中,它描述了如何使用电话号码注册创建帐户。
When signed in, Firebase returns a user object that looks like this:登录后,Firebase 返回用户 object,如下所示:
However nowhere in the above docs does it describe how to add information like email and displayName during sign up.但是,在上述文档中没有任何地方描述如何在注册期间添加 email 和 displayName 等信息。
How do I add this information to a profile during the user signup using phone number authentication?如何在使用电话号码身份验证的用户注册期间将此信息添加到配置文件?
The API provides no way of providing additional information at the moment an account is first created. API 在首次创建帐户时无法提供其他信息。 However, there are links at the bottom of that page that send you to information about how to manage users after that.但是,该页面底部有一些链接,可将您发送到有关如何管理用户的信息。 In particular, you will want to read the section on updating a user's profile and setting a user's email address .特别是,您需要阅读有关更新用户配置文件和设置用户 email 地址的部分。 From the documentation:从文档中:
user.updateProfile({
displayName: "Jane Q. User",
photoURL: "https://example.com/jane-q-user/profile.jpg"
}).then(function() {
// Update successful.
}).catch(function(error) {
// An error happened.
});
And:和:
user.updateEmail("user@example.com").then(function() {
// Update successful.
}).catch(function(error) {
// An error happened.
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.