I've been doing some Facebook application development using Nikhil Kotharis Facebook.NET framework. I must say, I'm very happy with it. I thought I might post a simple class that I created that lets me use the infinite sessions that Facebook can provide you with. It might be the wrong way to go about it, but it works for me.
Firstly you need to store the SessionKey from each user as they use your application, you should also store if they are infinite by checking the SessionExpires property on the Session object.
The class is:
public class FBASession : Facebook.Service.Core.FacebookSession
{
private FacebookService _service;
public FacebookService Service
{
get { return _service; }
set { _service = value; }
}
private Facebook.Service.Core.FacebookSession _session;
public Facebook.Service.Core.FacebookSession FBSession
{
get { return _session; }
set { _session = value; }
}
public FBASession(string appKey, string secret, string sessionKey, string userID)
: base(appKey, secret)
{
_service = new FacebookService(appKey, secret, sessionKey, userID);
_session = _service.Session;
}
}
Now with this we can use the data we store to create a session and send messages to any user of the application:
FBASession FBSession = new FBASession("<app key>", "<secret key>", "<stored session ID>" , "<facebook ID of user>");
FBSession.Service.Notifications.SendNotification("<facebook ID of user>", "<fb:userlink uid=\"" + facebookUserID + "\" /> has done something and wants you to know", null);
This will allow your facebook application to send a notification (or update the mini-feed etc ) to/of another user.
I was lucky enough to attend a presentation on ASP.NET Ajax at tech-ed that Nikhil presented, it was one of the better sessions at tech-ed, so thanks for all your effort.