Facebook Developer Toolkit 1.6 Released on CodePlex
We've released the latest version of the Facebook Developer Toolkit on CodePlex.
This release addresses a change to the Profile.SetFBML() method within the Facebook API. As of Thursday, Jan 17, 2008, Facebook will no longer accept the legacy version of this method, which allowed three versions of Facebook Markup Language (FBML) within the same parameter. The updated version of the Profile.SetFBML method will accept three separate parameters to limit unnecessary parsing, which will ease profile load times.
Using the Facebook Developer Toolkit, the previous call of
FBService.SetFBML(generalFBML, FBService.UserId);
now becomes
FBService.SetFBML(profileFBML, profileActionFBML, mobileProfileFBML, FBService.UserId);
A full example to test setting the profile FBML would look like:
new protected void Page_Load(object sender, EventArgs e)
{
base.Api = FACEBOOK_API_KEY;
base.Secret = FACEBOOK_SECRET;
base.Page_Load(sender, e);
if (!IsPostBack)
{
try
{
// Use the FacebookService Component to populate Friends
Facebook.Entity.User u = FBService.GetUserInfo();
Collection<Facebook.Entity.User> f = FBService.GetFriends();
//Test Get/Set FBML (Profile parameter)
string userMessage = string.Format("Hello, {0}, you have {1} friends!", u.Name, f.Count);
FBService.SetFBML(userMessage, null, null, FBService.UserId);
lblHelloWorld.Text = FBService.GetFBML(FBService.UserId);
}
catch (Exception)
{
// do error handling
}
}
This is a breaking change for existing code, which we felt was more logical than throwing a runtime exception. Post comments to the CodePlex site's discussion board if you have questions or comments.