Afnan Bashir
Afnan Bashir

Reputation: 7429

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

Upvotes: 2

Views: 2172

Answers (3)

Volodymyr Ivanov
Volodymyr Ivanov

Reputation: 159

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

Upvotes: 0

Aswath Krishnan
Aswath Krishnan

Reputation: 1181

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);

Upvotes: 3

Pavel Surmenok
Pavel Surmenok

Reputation: 4672

You must have your application user grant stream_publish extended permissions then you may use the Graph API to publish to friends' streams.

Upvotes: 2

Related Questions