title: React Native + Firebase Auth - displayName
body: <p>I'm working on a registry screen inside an application made with React Native. I am using Firebase authentication to create a new user.</p>
  
  <p>On the login screen, I'm using .signInWithEmailAndPassword (to access an account), and on the registration screen I'm using .createUserWithEmailAndPassword (to create a user), and reading articles about Firebase authentication, I know I can use displayName to receive the name user, and photoUrl to receive a photo of the user.</p>
  
  <p>What I would like to do is create a new user using the username, email and password. Even reading articles on the subject, I don't know a way to do this.</p>
  
  <p>THIS IS MY CODE:</p>
  
  <pre><code>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.
    this.props.firebaseApp.auth().createUserWithEmailAndPassword(this.state.email, this.state.password).then((userData) =&gt; {
     // then and catch are methods that we call on the Promise returned from
     // createUserWithEmailAndPassword
     Alert.alert('Success', 'Congrats!', [{text: 'OK!', onPress: this.dismiss}]);
     this.setState({
       // Clear out the fields when the user logs in and hide the progress indicator.
       email: '',
       password: '',
       loading: false
     });
     AsyncStorage.setItem('userData', JSON.stringify(userData));
     this.props.navigator.push({
       component: Account
     });
   }).catch((error) =&gt; {
       // Leave the fields filled when an error occurs and hide the progress indicator.
       this.setState({
         loading: false
       });
       Alert.alert('Ops', 'Error: ' + error.message, [{text: 'OK!', onPress: this.dismiss}]);
    });
  }
  </code></pre>
  
  <p>Basically I want to create a new user with the user name, email and password using the Firebase Authentication.</p>
  
  <p>Can any of you guys give me an example of how I can create a user with username, email, and password?</p>
  
  <p>If you want to see what I'm trying to do, I created a project to improve my knowledge in React Native? <a href="https://github.com/JoaoVRodrigues01/React-Native-Codec-App" rel="nofollow noreferrer">https://github.com/JoaoVRodrigues01/React-Native-Codec-App</a></p>