使用Google身份验证/ Facebook身份验证创建新帐户时,我想将他们的uid写入名为Users/
的树。
我应该怎么做?
firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
}
// The signed-in user info.
var user = result.user;
// Maybe something like this?
if (result.newUser) {
// Write to database
}
}).catch(function(error) {
// Handle Errors here.
});
谢谢!