0

Did any of you encountered some issues on facebook api v2.4

Whenever I called AuthenticationManager.GetExternalInfoAsync, the info only returns ID and Name. This did not happened on some of our apps on api v2.3. I also updated the facebook package on nuget but still no luck

I also tried checking the what is returned by facebook through fiddler (graph.facebook.com/me), but I can only see two fields on the returned JSON.

I appreciate any help. Thanks in advance!

jaxx05
  • 29
  • 1
  • 4

2 Answers2

0

Have a look at my answer at

You have to specify each field now with Graph API v2.4.

Community
  • 1
  • 1
Tobi
  • 31,405
  • 8
  • 58
  • 90
  • thanks. Seems like I had to deal with Microsoft Owin with this, to add the new parameters. – jaxx05 Jul 30 '15 at 13:24
  • No, you have to change your request URL, as described in the answer I linked, so that it includes the fields parameter – Tobi Jul 30 '15 at 13:28
  • @Tobi, I suspect not all such frameworks/SDKs expose the actual API request that is made to the user; if they handle that in the background, then indeed the code will have to be adapted on the framework/SDK creator’s side. – CBroe Jul 31 '15 at 13:23
0

Thanks guys,

I kinda make a work around with this, and I needed to make additional codes

        var loginInfo = await AuthenticationManager.GetExternalLoginInfoAsync();
        if (loginInfo == null)
        {
            return RedirectToAction("Login");
        }

        var fbAccessToken = loginInfo.ExternalIdentity.Claims.Where(a => a.Type == "FacebookAccessToken").FirstOrDefault().Value;

        var fbacc = ApiHelper<ExternalAccount>.GetByFullAddress(string.Format(@"https://graph.facebook.com/me?access_token={0}&fields=name,email,first_name,middle_name,last_name", fbAccessToken), null);

I hope there will be a cleaner way for this sooner. Again, thanks everyone!

jaxx05
  • 29
  • 1
  • 4