2

I'm trying to add a Share button to my website's various pages but I've found so many options I don't know which one is the most correct.

Official method: https://developers.facebook.com/docs/plugins/share-button

I can't get this to work. If you'd like to check out a live example on my website pls comment :-) The share button appears, I click it, it opens but when I click 'share' again in the dialog, nothing happens. (the fb account is fine, I checked using other website's share buttons)

SO answer using share.php which I heard was no longer officialy supported: facebook Sharer popup window

Finally the facebook share dialog (official): https://developers.facebook.com/docs/sharing/reference/share-dialog

This method lists the use of 'app ID' which I'm having trouble with. It says to use a public ID and it IS required (not according to several SO questions), and I can't find how to do that.

Hence, I ask: What is one method that will surely work to implement normal share button (topic+image+small description) on my website? Thank you.

Community
  • 1
  • 1

1 Answers1

0

I'd really need to see more of your implementation, but I have some thoughts. As Facebook always requires the use of their Javascript SDK for their recent tools, you could check out that the SDK is loaded correctly.

Another thought: The SO answer with sharer.php seems a decent starting point. If you don't need everything to happen in a window/overlay, you can just create a simple link and point it to

https://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=Google&p%5Burl%5D=http%3A%2F%2Fwww.google.com

with p[title] as the page title and p[url] as the url of the page you want to share. This has been a reliable solution for me for years, as it doesn't rely on any Javascript and works in virtually all environments.

If you like you can always make the link open in a window via Javascript you can add yourself, so it's easy to debug.

oelna
  • 2,210
  • 3
  • 22
  • 40