Connect/Creating Invites and Requests
From Facebook Developer Wiki
Share your Web application with your users' friends on Facebook using the built-in tools that Facebook provides.
Contents |
Benefits
With each individual on Facebook comes identity. Never before were website developers able to identify the users visiting their websites in the way they are now. With Facebook Connect, each user has the power to invite more friends, bringing more identification, demographic information, and more knowledge to your website or desktop or iPhone application, making it all the more important for you to know who is using your product.
With Facebook invites and requests and some very simple code on your website, the power of word of mouth from user to user is now in your hands. With a good website or product, your users will share your site at little to no advertising or marketing costs to you to spread your brand. That is the power of Facebook Connect. Let’s show you a little about how it works.
How It Works
Sharing With Friends Using Invite Forms
Displaying a user’s Facebook friends so he or she can invite them to do something on your website is simple! With just a few FBML tags you’ll be presenting invite forms for a user to invite their friends in no time. Let’s share with you a few of the different types of invite and request forms you can provide your users:
Inviting Friends With the Full Multi-Friend Selector
The full multi-friend selector is the largest friend selector available, and enables users to choose from a list of friends, either just with their mouse, or by typing in the names of individuals and having the selector choose friends for them. The full multi-friend selector has the following advantages:
- Users can see their friends’ profile pictures, making it easier to identify and pick out friends.
Inviting Friends With the Condensed Multi-Friend Selector
The condensed multi-friend selector gives you just the type ahead input box used in the multi-friend selector. Users type in the box, and their friends show up gradually filtered in a drop-down as they type. Its advantages are:
- Less space to display friends so you can fit more of your own stuff around it.
- Much simpler design, and less work by the user to select their friends. They just type, and select their friends.
While it is simpler, keep in mind that users cannot see the profile photos of their friends with this, making it a little more difficult to select lots of friends.
Customizing Your Invitations With API Requests
While classified differently than an invite or request, websites can customize their invitation form by creating their own and using Facebook API calls to retrieve the friends’ list and sending notifications via the notifications.send API method. This subject is beyond the matter of this document however, but you can read more about sending notifications using the notifications.send method.
What a Request or Invite Looks Like to Your Users
Invites and requests are two very similar techniques for allowing your users to message their friends. There are very few differences between the two. For the most part, the difference between an invite and a request is in how a user sees them when they log into Facebook. Here are the differences that a user sees:
Invites
An invite appears on a user’s home page as "1 (App Name) Invitation" in the upper-right corner. Occasionally, when there are many invites or requests, it will show up as "5 (App Name) invitations" or "5 other invitations". Here is what it looks like on a user’s home page:
When a user clicks the link from the home page to view their invitations, they’ll see a list of invitations, and sometimes requests mixed in. An invitation looks just like a request, but is worded, "You have an (App Name) invitation", along with "(User’s name) sent an invitation using (App Name)" and the details sent in the invitation XFBML. Note that a user can accept or ignore the invitation at a minimum, along with any additional instructions specified in the fb:request-form XFBML tag. Here is what it looks like:
Requests
Requests are almost exactly the same as invites, except that instead of “Invitation”, it says “Request”. See above for the exact wording. You may want to use a request when a user isn’t explicitly inviting their friends to join your website, but rather just “requesting” them to do something within the site. It’s simply a matter of wording.
Here is how a request looks to the user on their home page:
Here is how it looks when they click the request from their home page:
Case Study 1: SocialToo.com
SocialToo.com, which produces surveys and other tools to help people learn more from their friends on Facebook, uses Facebook Connect to better introduce their members’ friends to their product.
To invite their friends to use SocialToo, a user simply logs in via Facebook Connect, and a link to invite their friends appears.
When a user clicks the link, a multi-friend selector form appears, prompting them to invite their friends to use the service.
Those friends get an invite on their home page in Facebook. If they accept, they are taken back to SocialToo where they too can register and create surveys and use other Facebook-related tools that SocialToo provides.
After inviting their friends the user is taken back to the home page where they can continue using SocialToo. This is one example of a simple invite form.
Case Study 2: FamilyLink.com
FamilyLink.com uses Facebook Connect to allow its users to identify family members that are on Facebook. To do so, its users log into FamilyLink.com via Facebook Connect.
To add family members, they click an Add Relatives link. This link presents a page that displays a multi-friend selector to identify a user’s friends that may also be family members on Facebook.
The invited members then get an invitation. If they accept, those members’ Facebook streams then get added to a user’s stream in FamilyLink.
Implementation
Learn how you can integrate invites and requests into your website.
Best Practices
Limits - Understanding Allocations and Creating Requests that Get Accepted
As always, you want to be sure you are living within your application request limits at all times. You may want to check before displaying the fb:request-form to a user to verify your application hasn’t already hit its limit for the day, saving a few requests to Facebook’s servers. Be sure to read above on how to do this.
Using Exclude Lists to Choose which Friends Appear to Your Users
In your fb:multi-friend-selector tags you can specify individuals to exclude from the list. You’ll want to always use the API to determine which of a user’s friends are already using your website and exclude those from the list. In addition, it might be useful to track who a user is sending invitations and requests to, so you don’t encourage a user to invite the same friends more than once in a short period of time. Your users will thank you for this!
Appendix
Related API Methods
Related FBML Tags
Notification, Invite and Request Limits
- Notifications types
- Platform Principles and Policies
- Getting the remaining allocation for an app or user through admin.getAllocation
It's important to note that you can get your application’s allocation limit any time by going to your Insights at: http://www.facebook.com/business/insights/app.php?id=APP_ID (replacing APP_ID with the ID of your application).









