Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook - FB.UI feed and share dialog

I have some trouble with the Facebook FB.UI - Feed and Sare dialog. I need to send the page of the website to a friend, im using the FB.UI Javascript API. According to the facebook documentation they said you have to use the "from and to" parameter. But when i use the "from and to" parameters it doesn't work. When i delete these parameters it works fine, but i cant post to a friends wall for sure.

I've been looking for a while, and have try'd the following steps:

  • Does the user have enabled the right settings to post on his timeline (check)

  • Does the user have liked the facebook page (check)

  • Am i logged in (check)

This is the link to the documentation: Feed and Share Dialogs

This is my code:

PS: I get the alert what is saying: "Post was published" but it doesn't show up on facebook.

function share()
{
    FB.ui({
          method: 'feed',
          name: 'The name',
          link: 'The URL',
          from: '100001738814056',
              to: '100003105898115',
          caption: 'An example caption',
            },  function(response) {
                if (response && response.post_id) {
                      alert('Post was published.');
                } else {
                    alert('Post was not published.');
                    }
                }
        );
    }

edit: I've got some more information about my problem, and i guess i found the problem.. If you take a look at this image you'll see a row with: "Feed" and one with "?api_key=". If im taking a look at the URL of feed i guess it misses the get api key, not sure if iam correct

The image link

like image 230
MrYannick Avatar asked Nov 13 '13 15:11

MrYannick


1 Answers

We'll after a day of searching.. i know the solution.

If you create an app in Facebook, the mode of the app is " in sandbox mode ", when you turn the sandbox mode off you can post to facebook while tagging a friend!

So my problem is solved.

like image 111
MrYannick Avatar answered Oct 22 '22 09:10

MrYannick