【问题标题】:Tag friends on a feed post with php facebook sdk使用 php facebook sdk 在 feed 帖子上标记朋友
【发布时间】:2012-06-02 17:07:03
【问题描述】:

我要花 4 个小时在 facebook 上的页面上发送帖子

$attachment = array(
        'message' => "@[".$id.":1:".$name.'] dsf sadfewqr',
                    'name' => "test test etst etst test test",
                    'link' => "http://www.tiscali.it",
                    'description' => "test",
        'picture'=> "http://www.example.com/img.jpg",
        'message_tags' => array(
            'data' => array(
                'id' => $id,
                'name' => $partecipant['name_screen'],
                'offset' => 0,
                "type" => "user",
                'length' => strlen($name)
            )
        ),
        'access_token' => '--fanpageaccesstoken--'
    );

    $facebook->api('/'.$idfanpage.'/feed', 'POST', $attachment);

每次我只收到没有标签的消息。我做错了什么?

谢谢大家!

【问题讨论】:

    标签: php facebook sdk tags publish


    【解决方案1】:

    你从哪里得到 message_tags 参数?

    根据https://developers.facebook.com/docs/reference/api/user/#posts,您应该使用 tags 参数来给出逗号分隔的用户 ID 列表。

    并注意注释说,如果不指定地点,则不能指定此字段。

    【讨论】:

    • 我使用读取参数出错了。以及如何在消息中使用标签?谢谢你的回答
    • 您的真正意思是标记是指说您和其他人在某个地方,还是只是指在帖子中提及某人,就像您可以在 facebook 上输入@username 一样?后者显然无法通过 API 实现,另请参阅 stackoverflow.com/questions/3099183/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多