1

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?

Ali
  • 261,656
  • 265
  • 575
  • 769
  • possible duplicate of [Facebook apprequest Link"wrong"](http://facebook.stackoverflow.com/questions/10381599/facebook-apprequest-linkwrong), actually I've described this couple of times on similar questions too: http://facebook.stackoverflow.com/questions/9857406/friends-requests-on-external-website-not-working and http://facebook.stackoverflow.com/questions/10383137/giving-a-redirect-url-parameter-when-sending-an-app-generated-request-to-a-faceb – Juicy Scripter Jun 11 '12 at 17:02
  • 1
    So you are suggesting an app request, which then will be loaded by a canvas page and from there redirect the user using a link stored in the data? But what if there's no canvas page? Not to mention the long path of redirections. And then the question of #13 in the [Facebook Platform Policy](http://developers.facebook.com/policy/): `The primary purpose of your Canvas or Page Tab app on Facebook must not be to simply redirect users out of the Facebook experience and onto an external site.` – Nitzan Tomer Jun 11 '12 at 17:15
  • Also app requests only work for users who have already connected to your app, so if a user wanted to invite his friends who weren't yet connected to the site, then we'll have to send a social/user request rather than app request – Ali Jun 11 '12 at 17:48
  • @ClickUpvote, this isn't correct. User requests can be sent to non app users but they appear as "invite" and doesn't show `message`. – Juicy Scripter Jun 11 '12 at 18:47
  • @NitzanTomer, I'm not saying this should be your main purpose, but don't see anything wrong with displaying link to external page or issue redirect in certain cases like request to follow user on external site. – Juicy Scripter Jun 11 '12 at 18:54
  • @JuicyScripter Is there a way to send app requests while letting a user select his friends which receive them? – Ali Jun 11 '12 at 19:04
  • @ClickUpvote, yep, you can use [Requests Dialog](https://developers.facebook.com/docs/reference/dialogs/requests) for that – Juicy Scripter Jun 11 '12 at 19:07
  • 1
    It says in the requests dialog page: `Requests are only available for Desktop Canvas apps and not websites`, which is the whole point of this question as far as I understand. There's no canvas page, and if one created it's for the sole purpose of navigating the user to the relevant link (from the data of the request) url outside of facebook, which is against the policy. – Nitzan Tomer Jun 11 '12 at 19:22
  • @NitzanTomer, *"only available"* can be understood the same as will not redirect user to place other that application canvas. IANAL, implementing such flow may or may not break the policies. I'm in no way encourage to break 'em... Again, you should consider consulting a lawyer to be sure it's ok in your specific case... – Juicy Scripter Jun 11 '12 at 19:49
  • @NitzanTomer What if in my canvas page, I simply redirected to the app authorization page (i.e where they see which permissions my app wants and authorize or deny them) and when they do it, it redirects them to my site? Would that be against the TOS? – Ali Jun 11 '12 at 22:59
  • I'm not a lawyer as well, but to me it seems that way since it's your only purpose. – Nitzan Tomer Jun 11 '12 at 23:15

1 Answers1

1

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.

Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
  • Thanks, I was thinking of doing this. 1) What are OG tags, 2) Is this allowed by facebook's TOS, or do they at least not enforce it if its not allowed? – Ali Jun 11 '12 at 16:49
  • 1
    The Open Graph meta tags give you a way to define the data which facebook associates with your urls. Each different url is an object in the Open Graph. You can read more here: [Using Objects](http://developers.facebook.com/docs/opengraph/objects/). Why wouldn't it be allowed? Or better yet, which part? – Nitzan Tomer Jun 11 '12 at 16:55
  • @NitzanTomer, There is a much simpler solution for that since requests can have additional data passed with 'em, which can be used to store desired page for redirection... See the questions I've suggested in a comments to original questions. – Juicy Scripter Jun 11 '12 at 17:08
  • 1
    Well, on the send dialog documentation [here](https://developers.facebook.com/docs/reference/dialogs/send/) it says `Note: Facebook messages is a channel for user-to-user communication, and not for applications to send messages to their users, or encourage users to spam their friends. In general, applications on Facebook should use Requests when communicating in game status (its your turn), inviting people to use an application, or sending messages to multiple people. You should offer the Send Dialog in situations when a user might otherwise send an email.` – Ali Jun 11 '12 at 17:51
  • However its rather stupid because requests only work for canvas, so if you don't use canvas, you don't seem to have any other way to let users invite their friends. – Ali Jun 11 '12 at 17:52
  • It seems that pinterest uses this method, so I'll go with that. – Ali Jun 12 '12 at 20:22