Question

My facebook app uses the Facebook C# SDK to publish to a user's Facebook profile. I'm currently publishing multiple posts with one attachment, but I'd much rather publish one summary post with multiple attachments. I've done this with the JavaScript API, but is it possible with the C# SDK?

This is my current publish code:

FacebookApp app = new FacebookApp(user.AccessToken);
string userFeedPath = String.Format("/{0}/feed/", user.FacebookUserId);

string message = String.Format("{0} earned an achievement in {1}",
                               user.SteamUserId, achievement.Game.Name);
dynamic parameters = new ExpandoObject();
parameters.link = achievement.Game.StatsUrl;
parameters.message = message;
parameters.name = achievement.Name;
parameters.description = achievement.Description;
parameters.picture = achievement.ImageUrl;

app.Api(userFeedPath, parameters, HttpMethod.Post);
Was it helpful?

Solution

We currently don't support multiple attachments. As far as I know you can't publish multiple attachments with either the graph or rest api. If you have a sample that shows how to do it, I will get it implemented in the SDK.

OTHER TIPS

i have the same code as yours but it doesent work for me. I am trying this:

public void plesni()
{
    try
    {
    dynamic parameters = new ExpandoObject();
    parameters.message = "xxxxxxx";
    parameters.link = "xxxxxxxx";
    // parameters.picture=""
    parameters.name = "xxxxxx";
    parameters.caption = "xxxxxxx";
    parameters.description = "xxxxxxxxxx";
    parameters.actions = new
    {
        name = "xxxxxxx",
        link = "http://www.xxxxxxxxxxxxxx.com",
    };
    parameters.privacy = new
    {
        value = "ALL_FRIENDS",
    };
    parameters.targeting = new
    {
        countries = "US",
        regions = "6,53",
        locales = "6",
    };

    dynamic result = app.Api("/uid/feed/", parameters, HttpMethod.Post);
  //  app.Api("/uid/feed", parameters);
        Response.Write("Sucess");
    }
    catch (FacebookOAuthException)
    {
        Response.Write("...... <br/>");
    }
}

if instead of uid I put me it works fine. I am hoping for your help. Have a good day.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top