简体   繁体   English

(OAuthException)(#200)用户必须已在C#上接受TOS-Facebook

[英](OAuthException) (#200) User must have accepted TOS on C# - Facebook

Well, I am trying make a app to write comments to facebook in C#. 好吧,我正在尝试制作一个应用程序以C#将评论写到Facebook。 Searching in google I know that I need an Application (I did it) and I need select the permissions. 在谷歌搜索我知道我需要一个应用程序(我做了),我需要选择权限。 I did it.. Now I wrote my code in C#: 我做到了。现在我用C#编写代码:

private string MyAppId = "XXX";
private string MyAppSecret = "XXX";
private void button1_Click(object sender, EventArgs e)
{
  FacebookClient FB = new FacebookClient(MyAppId, MyAppSecret);
  Dictionary<string,string> data = new Dictionary<string,string>();
  data.Add("message","test");
  FB.Post("OBJECT_ID/comments", data);
}

But when I click the button I get this error: 但是当我单击按钮时,出现此错误:

(OAuthException) (#200) User must have accepted TOS (OAuthException)(#200)用户必须已接受TOS

I am getting crazy! 我快疯了! Please help me =( 请帮助我=(

It doesn't look like you're actually using the users access token. 看起来您实际上并不是在使用用户访问令牌。

You need to go through the OAuth workflow , where the user is redirected to facebook.com and grants your application permission. 您需要完成OAuth工作流程 ,在该工作流程中 ,用户将被重定向到facebook.com并授予您的应用程序许可权。 Once that happens, you'll get an Access Token that you use to make requests on behalf of the user. 一旦发生这种情况,您将获得一个访问令牌,该令牌用于代表用户发出请求。

There's an overload for the FacebookClient class that will take an access token. FacebookClient类有一个重载,它将获取访问令牌。

Since you didn't really expand on the type of app you're writing, the Facebook C# Github page has a collection of samples, for WinForms, ASP.NET, and Windows 8 Metro. 由于您并未真正扩展正在编写的应用程序的类型,因此Facebook C#Github页面包含用于WinForms,ASP.NET和Windows 8 Metro的示例集合。 This example should show you how to do client-side authentication. 本示例应向您展示如何进行客户端身份验证。

You're also trying to post to OBJECT_ID, which isn't a valid user/post/page. 您还尝试发布到OBJECT_ID,这不是有效的用户/帖子/页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Occassional(OAuthException - #200)(#200)用户必须已接受TOS - Occassional (OAuthException - #200) (#200) User must have accepted TOS C#facebook sdk:(OAuthException-#100)(#100)GK中的应用程序只需通过TOS检查 - C# facebook sdk : (OAuthException - #100) (#100) Apps in the GK only need to pass TOS check OAuthException Facebook C#SDK ie9 - OAuthException Facebook C# SDK ie9 Facebook c# sdk 错误 OAuthException - #2 - Facebook c# sdk error OAuthException - #2 (OAuthException)在Facebook C#SDK上验证带有动态用户= FbApp.Get(“ me”)的访问令牌时出错 - (OAuthException) Error validating access token w/dynamic user = FbApp.Get(“me”) on Facebook C# SDK OAuthException 200 Facebook sdk wp8 - OAuthException 200 facebook sdk wp8 使用Facebook C#SDK发布到Facebook页面时,我怎么突然开始收到OAuthException - How come I suddenly start receiving OAuthException when posting to facebook page using facebook c# SDK Facebook C#SDK:必须使用活动访问令牌来查询有关当前用户的信息 - Facebook C# SDK: An active access token must be used to query information about the current user 方法必须有返回类型(C#) - Method must have return type (C#) C# - 检查用户是否登录Facebook - C# - Check if user is logged in Facebook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM