Open placidovlm opened 4 years ago
final result =
await facebookLogin.logIn(["email", "public_profile", "user_friends"]);
print(result.errorMessage);
switch (result.status) {
case FacebookLoginStatus.loggedIn:
final token = result.accessToken.token;
final graphResponse = await http.get(
'https://graph.facebook.com/v2.12/me?fields=name,picture.width(800).height(800),email&access_token=$token');
final profile = JSON.jsonDecode(graphResponse.body);
break;
}
then in your profile variable there is :
{
"name": "Iiro Krankka",
"first_name": "Iiro",
"last_name": "Krankka",
"email": "iiro.krankka\u0040gmail.com",
"id": "<user id here>"
}
you can get name by using print(profile["name"]
In changelog documentation section there is the text : "...renamed loginWithReadPermission to login" but, the correct is : "...renamed loginWithReadPermission to logIn"
And the "How do I use it?" in Readme documentation section needs update, with renamed method logIn