如何在Facebook的.NET SDK调用版本图形API服务? [英] How to call versioned graph API services in Facebook .NET SDK?
问题描述
看来,Facebook目前要我们打电话图形的版本端点API。例如, https://graph.facebook.com/v2.0/me ..
It seems that Facebook now wants us to call versioned endpoints of the Graph API. E.g., https://graph.facebook.com/v2.0/me...
请问的Facebook SDK的.NET 进行版本控制电话?难道我/我可以做一些指定版本?
Does the Facebook SDK for .NET make versioned calls? Do I/can I do something to specify the version?
推荐答案
Sanjeev得到它,有一个参数,您可以添加到指定的版本:
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"
});
如果您没有指定一个版本,它会默认为最古老的支持的版本: https://developers.facebook.com/docs/apps/versions#unversioned_calls
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将提醒你,你正在接近结束支持该版本。
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.
这篇关于如何在Facebook的.NET SDK调用版本图形API服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!