使用 facebook API 发布到朋友墙。 C#
我有以下代码。
public void PostToWall(string message, string targetId)
{
dynamic parameters = new ExpandoObject();
parameters.message = message;
parameters.target_id = targetId;
dynamic result = _fbApp.Api("/me/feed", parameters, HttpMethod.Post);
}
当 targetId 是经过身份验证的用户的 ID 时,效果很好。
但是,当 targetId 是经过身份验证的用户朋友之一的 targetId 时,它不起作用。
有人知道为什么吗?
I have the following code.
public void PostToWall(string message, string targetId)
{
dynamic parameters = new ExpandoObject();
parameters.message = message;
parameters.target_id = targetId;
dynamic result = _fbApp.Api("/me/feed", parameters, HttpMethod.Post);
}
Which works fine when the targetId is the id of the user authenticated.
However, when targetId is that of one of the authenticated users friends it doesn't work.
Anyone have any idea why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我怀疑是因为您尝试发布到您的提要,而不是朋友 -
/me/feed
FB GraphAPI 指定您发布到
http://graph.facebook.com/ PROFILE_ID/提要
。I would suspect because you're trying to post to your feed, not the friend -
/me/feed
The FB GraphAPI specifies that you POST to
http://graph.facebook.com/PROFILE_ID/feed
.很遗憾地告诉你,但你实际上无法做到这一点。
Facebook 更改了隐私设置,因此您无法使用应用程序访问好友墙
请在这里查找相关信息
https://developers.facebook.com/roadmap/completed-changes/
(寻找2月6日的变化)
Sorry to tell you, but you can't actually do this.
Facebook has change the privacy settings, so that you can't access your friends wall using an app
Please find the relevant info here
https://developers.facebook.com/roadmap/completed-changes/
(look for the change of February 6th)