Transfer custom text to a new Facebook Sharer button

I need to pass some AngularJS variables from my application to the new Facebook divider button, I use:

<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_LA/all.js#xfbml=1&appId=1438439249728371"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> 

And this:

  <div class="fb-share-button" data-href="http://mySite" data-type="button"> </div> 

Where can I place my own text in a dialog box?

Thanks!

+6
source share
2 answers

Sharer will not allow this. It will extract the og tags from the link and populate the contents in the dialog box.

If you want to add a cutomized description / picture / caption, you should use the Channel Dialog .

You can use the direct URL to invoke the feed dialog:

 https://www.facebook.com/dialog/feed? app_id=1438439249728371 &display=popup &caption={caption} &link={link-to-share} &description={description} &redirect_uri={redirect-url-to-your-site} 

You can check all available options here.

+13
source

If you use the Facebook SDK for JavaScript, you must use the quote parameter

  FB.ui({ method: 'share', display: 'popup', href: window.location.href, quote: "Your Custom Text" }, function(response){}); 
0
source

All Articles