Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 向firebase上的用户添加额外详细信息_Javascript_Firebase_React Native_Firebase Realtime Database_Firebase Authentication - Fatal编程技术网

Javascript 向firebase上的用户添加额外详细信息

Javascript 向firebase上的用户添加额外详细信息,javascript,firebase,react-native,firebase-realtime-database,firebase-authentication,Javascript,Firebase,React Native,Firebase Realtime Database,Firebase Authentication,我试图在用户通过firebase注册后向他们添加诸如名字和姓氏之类的详细信息,尽管我遇到了一些麻烦。用户似乎是在auth部分创建的,但用户节点不是在数据库上创建的 signup() { this.setState({ // When waiting for the firebase server show the loading indicator. loading: true }); // Make a call to firebase to c

我试图在用户通过firebase注册后向他们添加诸如名字和姓氏之类的详细信息,尽管我遇到了一些麻烦。用户似乎是在auth部分创建的,但用户节点不是在数据库上创建的

signup() {
    this.setState({
      // When waiting for the firebase server show the loading indicator.
      loading: true
    });
    // Make a call to firebase to create a new user.
    firebaseApp.auth().createUserWithEmailAndPassword(
      this.state.email,
      this.state.password).then(() => {
        this.setState({
          // Clear out the fields when the user logs in and hide the progress indicator.
          email: '',
          password: '',
          loading: false
        })
        this.userFirebase.child(firebase.auth().currentUser.uid).update({
          first_name: this.state.first_name,
          last_name: this.state.last_name,
        })
        NavigationActions.Venue()
    }).catch((error) => {
      // Leave the fields filled when an error occurs and hide the progress indicator.
      this.setState({
        loading: false
      });
      Alert.alert('Hold on to your baristas, first a few basics!', error.message );
    });
  }

如果单步执行代码,是否会进入
update()
调用?如果是,您的JavaScript控制台中是否显示任何错误消息?perfect找到它,使用的是firebase而不是firebaseApp,并且权限设置不正确