Search code examples
javascriptfacebookapisharefeed

Facebook Feed Dialog simplified?


I'm trying to add a share button or "feed dialog" as Facebook now seem to be pushing, to posts on my website. I'm basically looking for a way to simply allow users to click the button and be sent to the share preview page to post to their timeline or a friend's timeline etc.

The problem is that I don't really need an app (or at least I don't see the need in an app) and I'd like to avoid using their deprecated sharer url method.

What are my options? Can I use the feed dialog method without creating an app? I've tried going through their documentation but it just confuses me.

I'm not fussed whether it's JavaScript that opens a popup or if it redirects to a separate page (provided a redirect url can be provided to return users to the original page on my website).


Solution

  • you definitely need an app for the FB.ui feed dialog, but the user does not have to be logged in. Without an app, you can either use the sharer.php in a javascript popup, or you can use a like and/or send button. Just make sure to include Open Graph metadata in your page.

    https://developers.facebook.com/docs/reference/plugins/send/

    Be aware that you should also use an app (id) with the like or send button.