Created
July 27, 2014 16:03
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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