Inviting Friends with Facebook Connect
Instructions on how to invite friends using the Facebook Javascript API's popup methods. There are probably a lot of ways to do this, I've found this works for me.- Create a link to the javascript function
fb_connect_invite_friends(). You can see the implementation of this function in application.js. Note: This javascript function is not part of facebooker. - A typical call might look like this:
<%= link_to_function 'Invite your Friends!', "fb_connect_invite_friends({ type: 'Facebooker on Rails', invitation_copy:'Please accept this invitation to Facebooker on Rails.', request_action_text:'Invite your friends to join Facebooker on Rails' })" %> - That would result in a link like this:
- Depending on what you pass into the method will determine what text is displayed, what urls the user goes to on cancel/submission, how big the dialog is, etc.
-
Go ahead and try clicking the link above. If you cancel it (by hitting
'Cancel', not by hitting the 'x') you'll GET this page. If you send a
friend request you will POST to this page. If you send then
params[:ids]is set to the list of uid's you invited.
Comments