Reputation: 14514
I have seen on many websites who have a button. That share a story to yours facebook profile when you click on it. I have tried the Facebook Share button, but a dialog appears.
How do I create a Facebook share button that share content with only 1 click?
Upvotes: 0
Views: 4281
Reputation: 2278
Facebook has many restrictions concerning sharing content. There are a few roadblocks to one-click sharing.
What you tried used the Feed dialog
, which is the easiest way to share content to a user's profile or timeline. However, this brings users to a Facebook.com url where they must approve the content and enter their own message. You can set certain parts of what is shared (URL, title, description, etc), however under most circumstances you may no longer set the message that is shared. See http://developers.facebook.com/docs/reference/dialogs/feed/ for more details.
On the other hand, you can use Facebook Auth to publish to a users stream using the publish_stream
permission. However, this is an advanced technique that requires extra work on the part of the developer. You must create an application, allow the user to login, and request the publish_stream
permission from the user. After gaining permission, publishing to their stream can be accomplished with 'one-click,' or by simply using using javascript or server-side code.
The simplest solution is obviously using the Feed dialog
, which is two-clicks, but a whole lot easier than Authentication.
Upvotes: 1
Reputation: 940
you need to use open graph api in Facebook or add meta tags in the <head> </head>
of your pages, where your share button is placed.
look at this section, Sharing Rich Media
But you should use Like button instead, Share button is deprecated by Facebook.
Upvotes: 1