Search code examples
c#facebookfacebook-graph-apiwindows-phone

Post to facebook from WP App with images


I'm using this article to post messages to facebook from my app in windows phone. http://developer.nokia.com/community/wiki/Integrar_o_Facebook_numa_aplica%C3%A7%C3%A3o_Windows_Phone

It works fine, but my question is that is only possible to post text, but I want post text with image and link, like this

var postParams = new
{
name = "Facebook SDK for .NET",
caption = "Build great social apps and get more installs.",
description = "The Facebook SDK for .NET makes it easier a",
link = "link",
picture = "link_to_image"
};

This code is used in facebooksdk

Is possible do the same with facebook utils ?


Solution

  • You need to send request with parameters below:

    https://graph.facebook.com/v2.1/me/feed?name={0}&message={1}&caption={2}&link={3}picture={4}&access_token={5}
    

    All values (except access_token) should be encoded with HttpUtility.UrlEncode. You can remove any parameter if you don't need to post it.