I am trying to implement social media sharing buttons on my Website. I am successfull in implementing the facebook sharing button.
My Code :
<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/en_US/sdk.js#xfbml=1&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Now i can see the share button and i am able to share the required page. When i click the button another modal comes up :
Now i want when a user clicks the share button then a pre defined message should be there in the highlighted area. How can i acheive this here and also in LinkedIn, Twitter and Google+ buttons.
Do i have to use Open Graph Protocol for this? If yes then can anybody post an article regarding this or tell me how can i achieve this using OG.
For facebook : open graph will fetch og tags for description from that link to display description in share popup.
you can set title,description,thumbnail using meta tag like this.
For twitter: Go through this link see data-text.
https://dev.twitter.com/web/tweet-button/parameters