How to call versioned graph API services in Facebook .NET SDK?

早过忘川 提交于 2019-12-01 04:26:07

问题


It seems that Facebook now wants us to call versioned endpoints of the Graph API. E.g., https://graph.facebook.com/v2.0/me...

Does the Facebook SDK for .NET make versioned calls? Do I/can I do something to specify the version?


回答1:


Sanjeev got it, there is a parameter you can add to specify version:

FacebookClient fbClient = new FacebookClient();
fbClient.Version = "v2.2";
fbClient.Post("me/feed", new
{
    message = string.Format("Hello version 2.2! - Try #2"),
    access_token = "youraccesstokenhere"
});

If you are not specifying a version, it'll default to the oldest supported version: https://developers.facebook.com/docs/apps/versions#unversioned_calls

Facebook will warn you that you are nearing end of support for that version.

Don't take any chances that the auto-upgrade to newer version will work, better to develop, test and deliver with the latest version.



来源:https://stackoverflow.com/questions/28458334/how-to-call-versioned-graph-api-services-in-facebook-net-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!