How do I create a page for users to invite their facebook friends?

Do I need to use the Simple Facebook Connect plugin? or can I just use some facebook api code? Any help appreciated.

The example i’m trying to replicate is the interface at lookbook.nu. Once you login with facebook, there is a nice page to invite your FB friends.

Related posts

Leave a Reply

2 comments

  1. An easy way would be to include the Facebook Javascript code:

     wp_deregister_script('facebook');
        wp_enqueue_script(
            'facebook',
            'https://connect.facebook.net/en_US/all.js'
        );
    

    Then use the default Facebook invite page.

    <script>
            function facebookInvite(){
                var request = {
                    message: 'my message',
                    method: 'apprequests'
                };
                FB.ui(request, function (data) {
                    if (data.request_ids.length > 0) {
                        alert("Facebook invite successful.");
                    }
                });
            }
        </script>
    

    EDIT:
    Here are steps you can take to invite your facebook friends to your website.

    1. Create an application for your website in Facebook. http://developers.facebook.com/docs/guides/canvas/ . You will need to read up on forwarding a user to your main website instead of a facebook application page aka canvas page.
    2. While logged in to Facebook ( as the same user that created the Facebook app ) go to your website and hit the “invite facebook link”. See http://developers.facebook.com/docs/guides/web/ for details. This will send out the invites. Your friends will see a Facebook notification inviting them to your application. In our case, the application and the website is pretty much the same thing.
    3. When your friend accepts the application an icon will appear in their profile page. When they click that icon it will take them to your website. If you configure your application correctly, it will take them to your website and not the Facebook canvas page.
    4. When they land on your page you need some logic which handles a user coming in from Facebook.

    HTH