Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ismail Mayat 4511 posts 10062 karma points MVP 2x admin c-trib
    Mar 21, 2017 @ 11:35
    Ismail Mayat
    0

    Facebook api update

    Hello,

    So Skybrud social defaults to v2.2 of facebook api. This is being deprecated end of March 2017. I know you can set the api version i tried to set it to 2.8 however the api calls i make like getting a users facebook likes, talking about etc it returns 0. When i set it to 2.3 i get values again.

    Issue is end of July 2.3 gets depcreated. I notice that skybrud facebook works with 2.7 so is the best thing to use this instead for facebook calls?

    Regards

    Ismail

  • Anders Bjerner 467 posts 2781 karma points MVP 6x admin c-trib
    Mar 23, 2017 @ 21:04
    Anders Bjerner
    0

    Hi Ismail,

    In general the same should be possible with v2.8 of the Graph API. However the different versions of the API requires a a slightly different approach - eg. which parameters should be specified when calling the API.

    For instance when requesting a given Facebook page, with v2.3 and earlier, a number of fields with information about the page will be included in the response.

    From v2.4 and newer, only the id and name fields will be returned by default. To get any further fields, one must explicitly specify the fields to be returned by the Graph API.

    So with v2.8 of the Graph API, you can get the amount of likes and talking about count like this:

    service.Client.Version = "v2.8";
    
    FacebookPageResponse response = service.Pages.GetPage(new FacebookGetPageOptions {
        Identifier = "umbraco",
        Fields = "id,name,fan_count,talking_about_count"
    });
    
    <pre>@response.Body.FanCount</pre>
    <pre>@response.Body.TalkingAboutCount</pre>
    

    Notice that from v2.7 of the Graph API, likes are now called fan count instead. However the corresponding FanCount property is first supported in v0.9.4.9 of Skybrud.Social - which I just pushed to NuGet ;)

Please Sign in or register to post replies

Write your reply to:

Draft