【问题标题】:Tagging people in wall post with POST to Facebook Graph API使用 POST 到 Facebook Graph API 标记墙上帖子中的人
【发布时间】:2011-11-09 22:33:40
【问题描述】:

我在为墙贴中的人添加标签时遇到了一些严重的问题。我现在正在使用 CakePHP,并使用 FB API 发布到 Graph API。代码如下:

    $theMsg1 = $this->Connect->user('name').' tagged ';
    $theMsg2 = $friendName.' on the IF Tag website.';
    $msg1Len = strlen($theMsg1);
    $fbNameLen = strlen($friendName);`

    $fbcall = FB::api($fbID.'/feed', 'POST', array(
        'name'    => $theTag['Tag']['name'],
        'caption' => 'IF Tag is an application that allows you to interact with people on Facebook.',
        'message' => $theMsg1.$theMsg2,
        'message_tags' => array(
            $msg1Len => array(
                'id' => $friendID,
                'name' => $friendName,
                'offset' => $msg1Len,
                'length' => $fbNameLen
            ),
            'picture' => 'http://patronsocialclub.com/img/global/head/drinkmaker.gif',
            'link' => 'iftag.local'
        )
    ));

根据我的理解和阅读,我应该使用 message_tags 对象来标记帖子中的人,但它根本不起作用。它没有给出任何错误,只是没有标记。

我也尝试过使用我看过的其他帖子中的@[{userid}:1:{username}],但这似乎不适用于 API 的当前迭代。

【问题讨论】:

    标签: facebook facebook-graph-api cakephp-1.3


    【解决方案1】:

    在这里查看我的答案Facebook Graph API Post with_tags option

    它的要点是

    我认为您想要使用的只是“标签”,它应该只包含此处指定的 ID https://developers.facebook.com/docs/reference/api/user/#posts

    **请注意,如果不指定地点,您将无法执行此操作

    Facebook 现已发布提及标签,这可能是您需要的解决方案 https://developers.facebook.com/docs/opengraph/mention_tagging/,但它需要自定义打开图形操作。

    【讨论】:

      【解决方案2】:

      目前无法通过 API 在状态更新或帖子中标记朋友。 这是他们的愿望清单中的链接

      http://developers.facebook.com/bugs/351412111599830

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-05
        • 1970-01-01
        • 2011-12-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-10-20
        相关资源
        最近更新 更多