开发者

Facebook api status updates and the 'share' link

开发者 https://www.devze.com 2023-01-19 11:34 出处:网络
I have been updating status messages from my site to my clients facebook pages or fan pages using the PHP sdk like this

I have been updating status messages from my site to my clients facebook pages or fan pages using the PHP sdk like this


$facebook = new Facebook('facebookApiKey', 'facebookAppSecret'); 
$facebook->api_client->users_setStatus($statusText, $faceboo开发者_开发技巧kUid);

When the status is posted and it shows up in my news feeds, I only have an options to 'Comment' or 'Like' that post, but not to 'Share' it like other updates do http://grab.by/6Juz.

I'm not sure if that is even possible with users_setStatus? is there anything I need to change in my canvas page to allow this link to show up? is there any other api call that I need to use before/after the status update to enable this link?

Any suggestion is greatly appreciated.


I know this is old but as i was looking for this i thought i would post it any way. check out: http://forum.developers.facebook.net/viewtopic.php?id=90079

I am using a c# library for the graph api so you will need to make some adaptions:

public void PublishWithAction(string text, string actionName, string actionLink, long? targetID )
    {
        client.Post((targetID.HasValue ? targetID.Value.ToString() : "me") + "/feed", new Dictionary<String, Object> { 
            { "message", text },
            { "actions", new List<Object>{new {name=actionName,link=actionLink}}},
        });
    }

if you use "share" as the action name and "http://www.facebook.com/share.php?u=<ShareURL>" as the action link you get close to the facebook share option.

0

精彩评论

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