我使用我的Facebook个人资料创建了一个应用。我已经在我的asp.net MVC web项目中实现了功能,可以在Facebook上发布。但它只能将数据发布到我的个人资料中。当其他授权用户在其墙上发布数据时,它返回错误“远程服务器返回错误:(403)禁止”。我使用Graph API在Facebook上发布。
有人能为我解决这个问题吗?创建的应用程序中是否有任何设置?
我的重定向操作是
public ActionResult Success()
{
PostToFacebookWall auth = new PostToFacebookWall();
string Code = Request.QueryString["code"];
if (Code != null)
{
ImpactWorks.FBGraph.Connector.Facebook facebook = auth.FacebookAuth();
facebook.GetAccessToken(Code.ToString());
FBUser currentUser = facebook.GetLoggedInUserInfo();
IFeedPost FBpost = new FeedPost();
Session["postStatus"] = "gdgdgdgd";
if (Session["postStatus"].ToString() != "")
{
//FBpost.Message = Session["postStatus"].ToString();
FBpost.Action = new FBAction { Name = "test link", Link = "http://blog.impact-works.com/" };
FBpost.Caption = "Test Image Share";
FBpost.Description = "Test Image Desc";
FBpost.ImageUrl = "http://retailpos.blob.core.windows.net/localitem1/UHSK2KJEKE6VCSP783P59VB6SZ1c822580-d0ff-46fc-af85-681aacef232f.png";
FBpost.Message = "Check out test post";
FBpost.Name = "Test Post";
FBpost.Url = "http://blog.impact-works.com";
facebook.PostToWall(currentUser.id.GetValueOrDefault(), FBpost);
}
}
return Content("Posted succeessfully");
}