Reputation: 6667
It's hard to find documentation for the newest SDK. I have an app that users signed in agreeing to giving permission for the app to post on their wall.
Now I have the app's access token and I'd like to post and entry on the user's wall. Seems like a simple operation but I can't find any examples.
Upvotes: 2
Views: 4096
Reputation: 1038710
You could use the FaceBook C# SDK. Here's an article which illustrates how you could post on a user's wall:
dynamic messagePost = new ExpandoObject();
messagePost.picture = "http://yaplex.com/uploads/yaplex-logo-with-text-small.png";
messagePost.link = "http://yaplex.com/";
messagePost.name = "[name] Facebook name...";
// "{*actor*} " + "posted news..."; //<---{*actor*} is the user (i.e.: Alex)
messagePost.caption = " Facebook caption";
messagePost.description = "[description] Facebook description...";
messagePost.message = "[message] Facebook message...";
string acccessToken = "xxxx5120330xxxx|4xxxxx0c0f95bd3f62dxxxxx.1-10000xx4x73xxxx|2xx5xxx0566xxxx|z2xxxx37dxxxxsdDS23s_Sah34a";
FacebookClient appp = new FacebookClient(acccessToken);
try
{
var postId = appp.Post("24351740xxxxxx" + "/feed", messagePost);
}
catch (FacebookOAuthException ex)
{
//handle oauth exception
}
catch (FacebookApiException ex)
{
//handle facebook exception
}
Upvotes: 4