开发者

How to add "Share" action to feed dialog?

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开发者_如何学Python 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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜