2017-07-27 57 views

回答

1

你可以用Firebase Cloud Functions来做到这一点。

使用Trigger on user creation

exports.saveUserInDatabase = functions.auth.user().onCreate(event => { 
    const user = event.data; // The Firebase user 

    const id = user.uid; // The id of the user 
    const email = user.email; // The email of the user 
    const displayName = user.displayName; // The display name of the user 

    // Add user in the database 
    return admin.database().ref('/users').child(id).child('userData').set('userValue'); 
}); 

You can find here some firebase cloud functions samples.

+0

,谢谢你帮了我很多,与此有关。 –

相关问题