【发布时间】: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