It's nice to give users a way to invite friends to use the app. Not only because users share something useful with their friends, but also because it makes your application more viral. Facebook has imposed limits on how many invites a user can send, and may even deprecate the invite function in the future. Still, for the time being, its a nice thing for your app.
Invite forms are an example of fb:request-form. This is a special FBML tag that will build the entire form, including buttons. While this renders a form on the page, from the Drupal perspective, it is markup with a
<fb:request-form> tag, not a
<form> and therefore it is not built with Drupal's FAPI. However, we want third-party modules to customize these forms. So, we build a data structure very similar to a
$form array, then call
drupal_alter(), so that modules can customize, then finally call
drupal_render() to turn our data structure into markup.
Note that this recipe works for FBML Canvas Pages, and HTML Facebook Connect sites.
- Enable the fb/contrib/fb_friends.module, currently called "Friend Features".