2011-04-17 49 views
1

我正在尝试使用Facebook C#SDK为我的Facebook应用程序创建测试用户。使用Facebook C#SDK创建测试用户...?

不太清楚,如果我要去了解它的正确方法,但这里是我执行的代码...

FacebookClient client = new FacebookClient(FacebookApplication.Current); 
String url = String.Format("/{0}/accounts/test-users", FacebookApplication.Current.AppId); 

IDictionary<string, object> userParams = new Dictionary<string, object>(); 
userParams["installed"] = "true"; 
userParams["permissions"] = "read_stream"; 
userParams["access_token"] = AccessToken; 

dynamic fbResults = client.Post(url, userParams); 

我收到一个异常...

(OAuthException) (#15) The method you are calling must be called with an app secret signed session 

回答

3

删除userParams [“access_token”] = AccessToken;

var fb = new FacebookClient(appId, appSecret); 
dynamic result = fb.Post(string.Format("{0}/accounts/test-users", appId), 
    new { installed = true, permissions = "read_stream" }); 
Console.WriteLine(result); 
+0

感谢您的协助。大概应该尝试过......! – Sambo 2011-05-05 14:04:23

+0

我试着做同样的事情,但我仍然一直在得到这个错误!为什么会发生?!请检查它:http://stackoverflow.com/questions/5990051/oauthexception-15-the-method-you-are-calling-must-be-called-with-an-app-secr – Kassem 2011-05-13 19:37:42

相关问题