2

I want to add Facebook share button to my site. I created app on Facebook. Ran local server. Added to host-file 127.0.0.1 dev.mysite.com and added domain mysite.com and website http:/ /mysite.com(without space) to app settings in Facebook. Trying:

function shareOnFacebook(){
    FB.ui({
        method: 'share',
        display: 'popup',
        title: 'myTitle',
        href: 'mysite.com',
        caption: 'mysite.com',
        picture: 'http://www.picturesource.com/path/picture.jpg',
        description: 'myDescription'
    }, function(response) {
         if(response && response.post_id){}
         else{}
    });   
}

but in dialog window infromation is filled without params, that i sent with function FB.UI. Did i miss something necessary for having permission to put information to the dialog window?

  • If i just put **https://www.facebook.com/dialog/share?app_id=184484190795&caption=mysite.com&description=myDsecription.&display=popup&href=mysite.com&picture=http://www.picturesource.com/path/picture.jpg** to address bar then dialog window will be right. But if i will change app_id to mine(**184484190795** fbrell's id), there will result like i've just put only link to it. – Nikita Kuzin Apr 21 '17 at 15:03

2 Answers2

2

Since the API v2.9, this is no longer possible to customise the content of the feed dialog : https://developers.facebook.com/docs/sharing/reference/feed-dialog#deprecated-params

The only part you can customise is the "quote" content, which look like that :

Quote param with the API v2.9

Your code doesn't work because even if you force the API v2.5 or v2.8 with the "FB.init" call, each new Facebook APP is using the v2.9 :

you can't downgrade a Facebook APP

If you don't have any old Facebook APP in your own repository (< v2.9), you can't use the good old feed dialog.

Stéphane
  • 116
  • 6
  • Thank you! It was realy helpful. I was read this article on my native(russian) language and the latest information was dated by July 17, 2015. – Nikita Kuzin Apr 24 '17 at 12:50
  • Is there any other JS possibility to share a specific Image, Name and Description ?REgarding to the Documentation it should still work https://developers.facebook.com/docs/sharing/reference/feed-dialog there are just a few deprecated params ... – Brezelfelder Apr 28 '17 at 07:04
  • Changelog: https://developers.facebook.com/docs/apps/changelog?locale=en_US#v2_9_90_day_deprecations It looks like it is really dead ... -.- – Brezelfelder Apr 28 '17 at 07:46
1

You have to use the Feed Dialog for that, not the Share Dialog. The Share Dialog basically only accepts the URL to share and gets the OG Data from that URL.

andyrandy
  • 72,880
  • 8
  • 113
  • 130