Here is the code snippet I'm working with:
this.facebook.login(['email', 'public_profile']).then((response: FacebookLoginResponse) => {
this.facebook.api('me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)', [])
.then((profile: any) => {
let userData = {
email: profile['email'],
first_name: profile['first_name'],
picture: profile['picture_large']['data']['url'],
username: profile['name'],
id: profile['id']
}
alert(userData);
When I run this code in the emulator, the alert box displays:
[object object]
How can I fix this issue?