facebookfacebook-javascript-sdkfacebook-requests

How to invite users' friends via facebook?


I'm looking for a simple way for users to be able to invite their friends to follow them on my website.

E.g Bob invites sally to be a follower of Bob on mysite.com.

I was thinking of doing this via requests, however I've read that they only work for canvas apps and not regular websites, meaning if Sally accepted Bob's request, then my website would be loaded as an Iframe within facebook, this would break the layout of my site and won't look good.

Is there any solution, like showing users a link within the canvas which they can click to have canvas turned off and have them sent to my website?

In the facebook TOS it says that a canvas can't exist just for redirecting users, and yet it says that facebook requests should be used for inviting users to your site.

My question is, then what would be the proper way for a website to let their users invite their friends from facebook?


Solution

  • I think that the only way you can do that with facebook is by sending private messages to the invited users which contains the link to your "invite url".

    You can use the Send Dialog with the link parameter being the invitation page for your site.
    The problem with this method is that you can not control the message that is being sent, you can however put the needed info into the og tags of that link which are added to the message.

    Another approach is to use the Chat API where you have complete control over the messages that are being sent.
    Problems with this method is that you'll require an extra permission (xmpp_login) and that you'll need to implement a xmpp client.
    This is probably an overkill.