Get user email using facebook toolkit

Posted by Maki on Stack Overflow See other posts from Stack Overflow or by Maki
Published on 2010-05-25T20:59:02Z Indexed on 2010/05/25 21:01 UTC
Read the original article Hit count: 522

Filed under:
|
|

Hi! I try to get user's emails, I got extemded permissions, this is my code:

string email_address = "";

            var response = MainForm.stFacebookService.Api.Fql.Query(String.Format("SELECT email FROM user WHERE uid =  {0}", "1495548076"));

            XDocument xml = XDocument.Parse(response);

            XNamespace fbns = XNamespace.Get("http://api.facebook.com/1.0/");
            var users = from el in xml.Root.Elements(fbns + "user")
                        select new
                        {
                            email = el.Element(fbns + "email").Value,

                        };

            foreach (var email in users)
            {
                email_address = email.email;
            }

the result is apps+107889662579809.1495548076.779a95208d3e074f848b0bc5e3c38926@proxymail.facebook.com

what I'm doing wrong?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about facebook