Skip to content

Instantly share code, notes, and snippets.

@abjerner
Created July 27, 2014 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abjerner/c2fe4ef2bea5afa025ea to your computer and use it in GitHub Desktop.
Save abjerner/c2fe4ef2bea5afa025ea to your computer and use it in GitHub Desktop.
Current FacebookMeResponse class in Skybrud.Social doesn't expose an email property. Using this little hack the email adress can be obtained given that the Facebook app can access the email of the user.
// Get the raw string
string response = service.Methods.Raw.Me();
// Parse the JSON
JsonObject obj = JsonObject.ParseJson(response);
// Parse the JSON object (use as normal)
FacebookMeResponse me = FacebookMeResponse.Parse(obj);
// Get email
string email = obj.GetString("email");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment