Search code examples
facebook-opengraphsocial-networking

Change open graph title dynamically before sharing on Facebook


How do I change open graph title dynamically before sharing on face book?

The code is

FB.ui(
      {
        method: 'share_open_graph',
        action_type: 'og.likes',
        action_properties: JSON.stringify({
          object: {
            'og:url': myurl,
            'og:title': mytitle,
            'og:description': mydescription,
            'og:image': myimageURL,
          },
        }),
      },
      function(response) {
        console.log(response);
        // Action after response
      },
    );

Solution

  • You can´t, that option was just a workaround that does not work anymore. You must provide correct OG tags in the source of the shared URL.