在Facebook API的状态更新中标记朋友 [英] Tagging friends in status updates from Facebook API
问题描述
我最近遇到了这篇博文表示,可以从Facebook应用程序(=来自API)的状态更新中标记某人:
I recently came across this blog post that said that it's possible to tag someone in a status update from a Facebook app (= from the API):
然而,这似乎并不适用于我。
However, it doesn't seem to work for me.
它尝试了三种不同的方式:
It tried it in three different ways:
$post = $facebook->api('/me/feed', 'post', array(
'access_token' => $session['access_token'],
'message' => 'Hello @[562372646:Lionel Cordier], how are you?'
));
或
$access_token = $session['access_token'];
$message = 'Hello @[562372646:Lionel Cordier], how are you?';
$curl_post = 'access_token='.$access_token.'&message='.$message;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://graph.facebook.com/me/feed');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);
$data = curl_exec($ch);
curl_close($ch);
或
$access_token = $session['access_token'];
$message = 'Hello @[562372646:Lionel Cordier], how are you?';
$curl_post = 'access_token='.$access_token.'&status='.$message;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.facebook.com/method/users.setStatus');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_post);
$data = curl_exec($ch);
curl_close($ch);
但没有任何作用。我的结果是你好@ [562372646:Lionel Cordier],你好吗?在我的墙上。
But nothing works. The result I have is "Hello @[562372646:Lionel Cordier], how are you?" on my wall.
但是如果我输入你好@ [562372646:Lionel Cordier],你好吗?直接在Facebook上,它的工作正常。
But if I type "Hello @[562372646:Lionel Cordier], how are you?" directly in Facebook, it works correctly.
什么是我做错了?
推荐答案
我上周遇到这个问题,发现了以下错误报告, (给定当前的ASSIGNED状态)它不能完成:(
I was struggling with this problem last week and found the following bug report, which suggests (given the current ASSIGNED status) that it cannot be done yet:(
http://developers.facebook.com/bugs/395975667115722/
这篇关于在Facebook API的状态更新中标记朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!