Updating the profile FBML

Jul 12, 2007 at 1:11 PM
I update the FBML when the user is in my app and it shows in the appropriate profile box but how can I update the FBML so that they can see important app notifications etc.. without loading the app canvas?

Can I push fbml from a desktop app and to a user that isn't the logged in user? So my user sees they've been slapped with a wet fish without going into my app canvas.
Jul 12, 2007 at 1:36 PM
Yes. What others have done is.

Store the user ids of their app in a local data store.

Then depending on whether the profile updates are event trigger or periodic do one of two things.

1) Just Call SetFBML and pass in the userid when an event happens. For instance, if user 2 slaps a fish on user 1. Call SetFBML("YOUR FBML", 1)
2) If you just want to periodically call SetFBML to update the profile of your users with the latest state, write a service that runs and loops through your users calling setFBML on them. You will need an infinite session with your app to get this done. To get an infinite session, log in yourself and click the infinite session checkbox. Then store the sessionKey and UserId. Your service then needs to set the api, secret, session and user on the FBService prior to calling SetFBML on behalf of your users.

Jul 12, 2007 at 2:50 PM
Thanks Ryan, so in theory each user can getFBML and tag their slap at the end and then setFBML so they don't overwrite the existing FBML for that user\app combination. The server can overwrite\update and refresh everyone's globally from time to time...

Also, it's interesting to note that if you set the FBML to "" then it removes the box off the profile page which is fantastic and I hope that they don't change it...
Jul 12, 2007 at 3:02 PM
Yes. That should work. But, I think we are missing GetFBML from our toolkit. So, we need to add it.