Feed Publishing

The .NET Facebook API Client makes working with Feed templates stupidly easy by allowing you to define your templates in an XML file with a friendly name, and then automatically registering the templates for you when your application initializes.

Configuration

<feedTemplates>
  <feedTemplate name="testStory">
    <oneLineTemplate>{*actor*} is kicking butt with the new .NET API Client.</oneLineTemplate>
    <shortStory>
      <title>{*actor*} is kicking butt with the new .NET API Client.</title>
      <body>The .NET API client makes posting stories like this ridiculously easy!</body>
    </shortStory>
    <actionLink>
      <text>.NET API Client</text>
      <href>http://apps.facebook.com/dotnetapi</href>
    </actionLink>
  </feedTemplate>
  <feedTemplate name="DemoStory">
    <oneLineTemplate>{*actor*} is checking out the new .NET Facebook API Client.</oneLineTemplate>
    <shortStory>
      <title>{*actor*} is checking out the new .NET Facebook API Client.</title>
      <body>There's a new cowboy in Facebook API-towne! Yeehaw!</body>
    </shortStory>
    <actionLink>
      <text>.NET Facebook API Client</text>
      <href>http://apps.facebook.com/dotnetapi</href>
    </actionLink>
  </feedTemplate>
</feedTemplates>
It is recommended that you save the file with the .config extension so that the file cannot be downloaded.
<facebook feedTemplateConfigSource="web.facebook.templates.config">

Publishing

Note: There are currently only helpers for ASP.NET MVC applications. ASP.NET server controls are planned to provide similar functionality for a future release for WebForms applications.

FBML Applications

<%= Fbml.FeedForm("DemoStory", "Publish") %>
When the user clicks "publish", the FeedController will automatically handle the resulting POST from Facebook for you.

IFrame Applications

<%= FbIFrame.FeedForm("DemoStory", "Publish") %>
Note: additional fields are not supported at this time.