Over the break I took a look at updating my Facebook Developer Toolkit (FDT) Starter kit to the latest v3.0 release that was announced at PDC. My first thought was to download the sources via SVN but unfortunately, that failed so I resorted to using the SDK Source download which I’d rather not do as it leaves no easy way to keep up-to-date with recent checkins.
Anyway, I built the sources which “just worked”, surely a good sign.
Next, I worked to compile and run my Starter Kit application and here is what I found (at least so far):
- Delete old referenced assemblies
- Change using statements:
- using facebook; –> using Facebook
- using facebook.web; –> using Facebook.Web;
- using facebook.Schema; –> using Facebook.Schema;
- Master.API.uid; –> Master.Api.Users.GetLoggedInUser();
- Master.API.friends.getUserObjects(); –> Master.Api.Friends.GetUserObjects();
- Master.API.photos.getAlbums(); -> Master.Api.Photos.GetAlbums();
- facebook.Schema.user –> Facebook.Schema.user
- Master.API.users.getInfo(Master.API.uid); –> Master.Api.Users.GetInfo(Master.Api.Users.GetLoggedInUser());
- facebook.fql q = new facebook.fql(Master.API);
- Add using Facebook.Rest
- facebook.fql q = new facebook.fql(Master.API); –> Fql q = new Fql(Facebook.Session.FacebookSession);
- Convert Site.Master page Page_Load method to a constructor setting RequireLogin = true;
- Regular Expression bug
Until I get some time to resolve the RegEx issue the rest will be on hold for a bit though things are looking pretty good and the above didn’t take long at all. I have noticed a few worrisome comments on the discussion forum.
I’ve updated my ASP.NET Facebook Starter Kit with the following improvements/changes:
- Added support for dynamically resizable iframe which avoids a scrollbar though may have some side effects/caveats. Code is based on JavaScript sample from Facebook.
- Added an example of XFBML which requires xd_receiver.htm (included) allowing for a Cross Domain Communication Channel
- Added example of using FQL, refer to FQL.aspx
- Updated Facebook Dev Toolkit assemblies
- Added Facebook stylesheet from Bill Konrad
The download is here and full directions for installation and use are here. To see this application running on Facebook click here. As always, please direct questions on the Facebook API to the Developer’s Forum, or on the Facebook Developer’s Toolkit to the discussion list.
[Updated: Jan 15, 2010] This post is now outdated so please look for my updated versions. The latest is always available on my wiki.
UPDATED Nov. 6, 2008: A new release is available
here.
I’ve updated my
Facebook Starter Kit to version 1.3 of the
Facebook Developer Toolkit published by Microsoft available on
CodePlex. I also cleaned up the code and moved the Appkey and Secret so their read from web.config.
Btw, I’ve had a few questions in email about how to fetch a friend list which can be done as follows:
if (!IsPostBack)
{
System.Collections.ObjectModel.Collection<User> userinfo =
_fbService.GetUserInfo(_fbService.UserId);
Label1.Text = "Hi, " + userinfo[0].FirstName;
Image1.ImageUrl = userinfo[0].PictureUrl.ToString();
// Use the FacebookService Component to populate Friends
System.Collections.ObjectModel.Collection<User> Friends =
_fbService.GetFriends();
for (int i = 0; i < Friends.Count; i++)
DropDownList1.Items.Add(Friends[i].FirstName.ToString());
}
If you haven’t seen it I’ve also created a starter kit for
Nikil Kothari's
Facebook.NET framework so be sure to take a look a that as well.
Enjoy!
Back in July Nikhil Kothari released Facebook.NET which is an ASP.NET wrapping of the Facebook API. Facebook.NET is a bit different approach than Facebook Developer’s Toolkit and provides some ASP.NET controls that wrap some of the more useful elements of the FB API. Nikhil and I exchanged a few emails back in July and he asked if I’d put this together but I’d just started a new job and was in the midst of remodeling my house and now things have settled down I decided to get it out.
Use of this starter kit is very close to the previous one I released. The kit includes a Welcome.htm which is displayed in VS.NET when you create a new application that has all of the details of getting the two flavors of FB application (IFrame and FBML) up and running. One note, I tweaked the FB API version in FBML\Default.aspx since "0.3" is no longer supported.
Let me know if you have any problems.
Download[UPDATED: Jan 14, 2008] I updated the Starter Kit to v0.3 of Facebook.NET. Additionally, the starter kit has been updated to VS.NET 2008
[UPDATED: May, 6, 2008] Here are some additional links: