使用 API Graph 发布到 Facebook 墙,但缺少分享按钮 [英] Post to facebook wall using API Graph and missing share button

查看:24
本文介绍了使用 API Graph 发布到 Facebook 墙,但缺少分享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Graph API 中使用分享按钮发布消息.我使用 SDK-PHP v3 和此代码:

Is it possible to post a message with share button in Graph API. I use SDK-PHP v3 and this code:

    $args = array(
        'access_token' => TOKEN_HERE,
        'message'   => 'message here',
        'link'      => 'http://www.example.com/',
        'caption'   => 'caption here'
    );
    $result = $facebook->api("/me/feed", "post", $args);

它工作正常,但缺少分享按钮.有一个评论和喜欢按钮,但没有分享按钮.请不要给我任何教程或粪便文档的链接.如果您知道如何执行此操作,或者您知道这是不可能的,只需编写它.谢谢!

It works fine but share button is missing. There is a comment and like button but no SHARE button. Please do not give me any links to tutorials or fecebook documentation. If you know how to do this or you know it's not possible just write it. Thanks!

推荐答案

好的,我找到了解决方案.也许有人会感兴趣.要添加带有分享按钮的链接,您必须使用me/links"而不是me/feed".

ok, I found solution. maybe someone will be interested. to add a link with share button you have to use 'me/links' instead of 'me/feed'.

$attachment = array(
    'access_token'=>TOKEN_HERE,
    'message'=>'message_here',
    'link' => 'http://www.example.com/',
);

$result = $facebook->api(
    'me/links',
    'post',
    $attachment
);

这篇关于使用 API Graph 发布到 Facebook 墙,但缺少分享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆