Is there a way for users of my website to invite their friends via Facebook Connect or the API?

Working with the Facebook API makes my ears bleed, but nonetheless I've got a specific problem here which I'm hoping someone can find a solution for. I'm using the Facebook PHP SDK to allow users of my website to link their FB account with their website account, so they can return later and log in with one click (by storing their OAuth tokens in my database). This is all working fine - what I now want is to be able to provide users with the facility to invite/recommend their friends to my site, using a form on my site.

I've tried FBML examples from many places including here - I've managed to get an invitation form to display but try as I might, all I can get it to generate is an invitation to my application, which isn't relevant. The app exists only so that I have an OAuth ID/secret to use with the Graph API. I want to invite the user's friends to my website, or at the very least to a Facebook Page plugging my website. But seemingly including this FBML on my page will only generate application invites.

My question: is there any way to accomplish this? Can I invite the user's friends to my site (ie. to a specific URL), or invite them to my FB Page? Am I approaching this from the wrong angle?

Any advice would be much appreciated. If you'd benefit from any further info, please let me know. Many thanks,

Biggs

Answers


Right. It turns out after much tearing of hair, the example I gave was the right one. The invite generates an "Application Invite", but this is not like other app invites. When the recipient clicks "Accept" they are sent to the URL you specify (in this case, my website). The "App" then disappears from their request page - it does not appear in their profile like a normal app. So a horribly nonsensical process but a positive outcome. Phew!


It seems like sending a Facebook message is the way to go at this point (Jan 2013).

https://developers.facebook.com/docs/reference/dialogs/send/

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.

FB.init({appId: 'YOUR_APP_ID', xfbml: true, cookie: true});

FB.ui({
    method: 'send',
    name: 'Check out this site!',
    description: 'This is the best site ever!',
    link: 'http://www.example.com/refer',
    picture: 'http://www.example.com/image.jpg'
});

Need Your Help

“Use MFC in a Static Library” links to MFC80U.dll

mfc windows-ce visual-c++

In my Windows CE DLL project, I am trying to tell Visual C++ to link statically to MFC in a project that originally did not use MFC. However, upon linking successfully, Dependency Walker (depends.e...

WPF Zoom + Scrollbar?

wpf xaml zoom

I'm trying to zoom some contents within scrollviewer.