Reputation: 57482
I'm using Facebook's Feed Dialog: http://developers.facebook.com/docs/reference/dialogs/feed/
Whenever I post something using it, Facebook adds 2 links at the bottom (Like and Comment):
However, when I see other posts in the Timeline, I also see a "Share" link as well:
How can I instruct Facebook to also add this "Share" link through the feed dialog?
Upvotes: 3
Views: 27882
Reputation: 472
Using the Like Button social plugin is nearly the same as using the Sharer.php method, and is the currently supported replacement for Share buttons.
If you have a web page, when a user clicks the "Like" button, they will post a link to their wall which will have a "Share" link in it.
You could do something similar within a canvas app, although this wouldn't work for Feed posts that need dynamic text, such as the user's name or some value from their actions in the app.
Upvotes: 0
Reputation: 7279
You cannot have share link for feed posts from an application but you can have for link posts as Explained in second example. Or You can also add action links to a post message like this.
FB.ui(
{
method: 'feed',
name: 'Facebook Dialogs',
link: 'http://venu.com/',
picture: 'http://venu.com/f8.jpg',
caption: 'Venu site',
description: 'asdasdasdasd.',
message: 'asdasdasd!',
actions: [
{ name: 'share', link: 'link here' }
]
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
Link will be to a custom page in your site/app. Since user is trying to share the messages which was posted by some body else, you should have the message in your server. You can pass the id of the message in the custom URl.
Hope this helps you :)
[EDIT]
or
You can add a link with share button you have to use 'me/links' instead of 'me/feed'. Unfortunately this isnt a complete replacement as Facebook ignores the description, title and picture parameters when using this method. this is bug posted here.(https://developers.facebook.com/bugs/194522957295380)
$attachment = array(
'access_token'=>TOKEN_HERE,
'message'=>'message_here',
'link' => 'http://www.example.com/',
);
$result = $facebook->api(
'me/links',
'post',
$attachment
);
So, now this is similar to having a like button in your site. Facebook pulls the information from open graph meta tags in the given link.
<head>
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="name for ENTIRE SITE"/>
<meta property="og:title" content="name of PAGE"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="<URL HERE>"/>
<meta property="og:description" content="my description" />
<title>Untitled</title>
</head>
Upvotes: 3
Reputation: 13614
Posts that have the Share option are native posts, not application posts. Your post has the "via Careers, Jobs and Recruitment App", meaning it's an application post. For you to have the native "Share" option, you'd have to use a native post, which involves using sharer.php (see "Creating your own Share URL" near the bottom).
Upvotes: 4