Frage

I am using https://github.com/sanjeevdwivedi/facebook-csharp-sdk to integrate facebook in my wp8 app. I want to know how to access the user email id using facebook-csharp-sdk below is the code I am using

FacebookSession session = FacebookSessionClient.LoginAsync("user_about_me,read_stream");
FacebookClient _fb = new FacebookClient(session.AccessToken);
dynamic parameters = new ExpandoObject();
parameters.access_token = session.AccessToken;
parameters.fields = "email,first_name,last_name";
dynamic result = await _fb.GetTaskAsync("me", parameters);

But I am getting only firstname , lastname and id of the logged in result field. Please suggest where am i missing?

War es hilfreich?

Lösung

You should ask for the email permission.

FacebookSession session = FacebookSessionClient.LoginAsync("user_about_me,read_stream,email");

The last item in the LoginAsync params I placed is email

See permissions for more info

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top