I am using Facebooker with Rails to connect my application to Facebook. I can direct the user through the authorization process and through the process of granting offline access to my application.
How do I actually go about accessing the information offline? Is there a way to request a session_key that does not expire that I can use at a later point, so long as the user has not revoked the permissions for my application on Facebook?
Any help greatly appreciated. Advice need not be rails specific.
Once you ask for, and are granted, offline access the session key you get in the HTTP POST parameters from Facebook (fb_sig_session_key) will have no expiry.
You can check you have such a key by checking the fb_sig_expires parameter, if this is "0" then the session key has no expiry.
If you have an auth_token then you can call getSession to get the session key and check the expires field:
EDIT: apparently, granting "offline_access" still gives you (and will continue doing so) an infinite session key. just save this special key and use it in your call to Status.get etc. see here for a (PHP) code example.
http://wiki.developers.facebook.com/index.php/New_Design_User_Login :
so if your app is granted offline_access, you can use API calls listed here without a session_key.
I just made a tutorial on my blog with a step by step explanation on how to access offline user's data. It assumes you're working with RoR and the Facebooker plugin.
Once you get offline access permission from a user, the trick is to call with a
filter_key
parameter of 'network'.In PHP, it is:
Try it, it works....