Is it possible to post to a users feed with a share action link?
I've noticed sometimes there's a share link on some things i开发者_JAVA百科n my feed. Is it possible to post to a users wall and attach an action link that has a share option that would create a share dialogue directly on the users feed? Something like this:
FB.ui({
method: "feed",
name: 'sometitle',
caption: 'somecaption',
description: 'some description',
link: 'http://www.facebook.com/pages/1234?sk=app_234123123',
picture: 'http://www.facebook.com/favicon.ico',
actions: [{
name: 'share',
link: '????'
}]
});
This is an outstanding FB issue.
Here's the FB bug: https://developers.facebook.com/bugs/164888633588257
I don't think it's possible. From the document, only the following option accepted : message, picture, link, name, caption, description, source.
I think it's easier to put some javascript in the target page(link), which call the share api seperately.
Sorry, Hoang isn't quite correct. You can create a share link, but it is a bit hobbled. Within your actions array, you should have a name of 'share' and a link as shown here:
$attachment['actions'] = array('name'=>'Share', 'link'=>"http://www.facebook.com/sharer.php?u=". urlencode($href))
While this won't pop up a native dialog box, it will give you some semblance of the share functionality.
精彩评论