2017-07-27 80 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

,謝謝你幫了我很多,與此有關。 –

相關問題