简体   繁体   中英

How can I post on a friends wall using facebook SDK c#

Can we post pictures/videos or links on friends wall using facebook SDK c#? i am using it in winforms .I am using this SDK https://github.com/facebook/csharp-sdk

public static void PostToWall(string wallPost, string friendId)
{
    var fb = new FacebookClient(Globals.AccessToken);
    var parameters = new Dictionary<string, object>(); 
    parameters["message"] = wallPost;
    fb.PostAsync(String.Format("{0}/feed", friendId), parameters);
}

If you want to post it to the wall of the user logged in, use:

fb.PostAsync("me/feed", parameters);

您必须先向应用程序用户授予stream_publish扩展权限,然后才能使用Graph API将其发布到朋友的流中。

It's recommended to use PostTaskAsync instead of obsolete PostAsync method of FacebookClient. The parameters remain the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM