Search code examples
c#facebookpostfacebook-c#-sdkpublish

publishing a post to your Facebook app's wall using C#


I'm trying to write a script that will publish posts to my Facebook application's wall. I can do a simple status update, but when I try to move to a post with a link, image, and description the formatting gets messed up.

dynamic parameters = new ExpandoObject();

        //define parameters of the post
        parameters.message = flyer.Description;
        parameters.link = flyer.Link;
        parameters.picture = webDomain + "/Resource/" + flyer.FileName;
        parameters.name = flyer.Title;
        parameters.caption = "this is a caption";
        parameters.description = "this is a description";

        //make the post
        var result = (IDictionary<string, object>)fb.Post("/" + APPID + "/feed",parameters);

The picture doesn't display. It is just a gray line on the left side, where the image should be. The title displays correctly, but instead of being a link to the article, it's a link to the image. the caption, message, and description all show up correctly.


Solution

  • figured it out. that works fine. the problem was that I was testing on localhost. when I switched the links to the dev site it worked fine. The above code works fine.