Retrieve name from Facebook native

Hello everybody!

I need to retrieve first and last name from Facebook after user register successfuly.

Actually i have:

Facebook
            .login(['email'])
            .then( (response) => {
               /*
              Here i need to get name and last name for later usage
              */
                let facebookCredential = firebase.auth.FacebookAuthProvider
                    .credential(response.authResponse.accessToken);

                firebase.auth().signInWithCredential(facebookCredential)
                    .then((success) => {
                        this.userProfile = success;

                        this.storage.set('facebookMethod_email', this.userProfile.email);

                        this.nav.setRoot(HomePage,
                            {
                            facebookUser: this.userProfile
                            },
                            {
                                animate: true,
                                direction: 'forward'
                            });
                    })
                    .catch((error) => {
                        let prompt = this.alertCtrl.create({
                        title: this.FAIL_TITLE,
                        subTitle: this.AUTH_FAILED_SUBTITLE,
                        buttons: [this.ACCEPT_BUTTON]
                        });
                    prompt.present();
                    });
            })
            .catch((error) => {
                console.log(error)
            });

And it works perfectly. It first do the register flow with facebook and then, register in firebase… But i need to get those user attributtes from facebook to store this information separately.

Thank’s in advance!
Ivan.

Hi did you ever figure out how to retrieve first and last name. I know how to retrieve display name but not the first and last