Reputation: 143
Does anyone know how to make the "Share" option appear next to the "Like" and "Comment" actions in posts generated through the feed dialog?
I can see that the "actions" property might support this, but I don't see any "share" dialog that could be plugged into the link (and the "send" dialog only sends private messages).
What I am looking for is a way to generate a standard Facebook "share" link (with full public/private sharing options) as an "action" property.
Here is our current feed dialog code:
<a href='https://www.facebook.com/dialog/feed?app_id=126736467765&
link=https://apps.facebook.com/karmalyze/?reqtype=action%26actno=$actno&
picture=$post_pict&caption=karmalyze...%20your%20life!&name=$share_act_title&
description=$share_act_description&message=Yummy%20Karma!&
redirect_uri=https://apps.facebook.com/karmalyze/?reqtype=action%26actno=$actno'
title='Share This'><img class='vmidimage floatright' src='images/icon_kk_fb.png' alt='Like Icon' /></a>
I see the "Share" option on many posts. Is this just for posts that Facebook generates, or has someone cracked this code for the rest of us? Thanks!
Upvotes: 1
Views: 2070
Reputation: 31
There is an approach that is messy but will do the job: use the action argument for the feed dialog.
function fbShare() {
//call the API
var obj = {
method: 'feed',
link: myLink,
picture: pic,
name: myNme,
caption: myCaption,
redirect_uri: 'http://facebook.com',
actions: {"name":"Share","link": url},
description: myDescription,
};
function callback(response) {
console.log(response);
}
FB.ui(obj, callback);
}
The actions url should be pretty much the same url as you are showing.
Drawbacks: you aren't given the option to post to someone else's wall and the redirect_uri, which must be present, winds up taking the user away from their wall.
Upvotes: 1