how do i implement like feature with facebook c# SDK?

雨燕双飞 提交于 2019-12-12 03:16:05

问题


I am using facebook C# SDK 5.3.2 for desktop application and i created desktop app using this sdk. I can now post messages but i also like and share posted messages. It seems that i should get postid and then post messages with parameter "/me/likes" along with postid. But i couln't manage it till now.


回答1:


for the graph to like a post (see https://developers.facebook.com/docs/reference/api/post/), all you need to do is HTTP post to {post ID}/likes without any parameters. This assumes the user has publish_stream permissions accepted. :)




回答2:


I think you can do:

var fb = new FacebookClient(accessToken);

IDictionary<string, object> para = new Dictionary<string, object>();

fb.PostAsync("/" + fbphotoid + "/likes", para);

Because PostAsync need one parameter.



来源:https://stackoverflow.com/questions/8590364/how-do-i-implement-like-feature-with-facebook-c-sharp-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!