-1

I am looking for invoking the facebook share functionality with the dynamic message in vaadin flow.

I have read how to generate AppId and all stuff in facebook developer link but how to get working with vaadin and that with the dynamic title and message.

I have worked on the following code

<html>
<head>
  <title>Your Website Title</title>


  <meta property="og:url"                content="http://www.nytimes.com/2015/02/19/arts/international/when-great-minds-dont-think-alike.html" />
  <meta property="og:type"               content="article" />
  <meta property="og:title"              content="hii" />
  <meta property="og:description"        content="hello" />
  <meta property="og:image"              content="http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/19iht-btnumbers19A-facebookJumbo-v2.jpg" />


</head>
<body>

  <!-- Load Facebook SDK for JavaScript -->
  <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 = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));</script>

  <!-- Your share button code -->

  <div class="fb-share-button" data-href="mylink" data-layout="button_count" data-size="small">
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=mylink;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>

</body>
</html>

I will have the different title and different description as the application will be deployed with different domains.

so how can I set the title and the message or description while facebook share?Just know it doesn't take anything in the vaadin applications.

kushal Baldev
  • 729
  • 1
  • 14
  • 37

1 Answers1

0

This one worked for me for sharing the contents on facebook without appId

https://www.facebook.com/sharer/sharer.php?u=%LINK%&quote=%CONTENT%

%LINK% = the link of your website %CONTENT% = the content you want to say for sharing will be displayed as quotes

kushal Baldev
  • 729
  • 1
  • 14
  • 37