问题描述
我最近遇到了 这篇博文 说可以在来自 facebook 应用(=来自 api)的状态更新中标记某人:
但是,它似乎对我不起作用.
它尝试了三种不同的方式:
$post = $facebook->api('/me/feed', 'post', array('access_token' =>$session['access_token'],'消息' =>你好@[562372646:lionel cordier],你好吗?"));
或
$access_token = $session['access_token'];$message = '你好@[562372646:lionel cordier],你好吗?';$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 = '你好@[562372646:lionel cordier],你好吗?';$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);
但没有任何效果.我的结果是hello @[562372646:lionel cordier],你好吗?"在我的墙上.
但如果我直接在 facebook 中输入hello @[562372646:lionel cordier],你好吗?",它就可以正常工作.
我做错了什么?
上周我一直在努力解决这个问题,并发现了以下错误报告,它表明(鉴于当前的 assigned 状态)还无法完成:(
http://developers.facebook.com/bugs/395975667115722/>
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?' ));
or
$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);
or
$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);
but nothing works. the result i have is "hello @[562372646:lionel cordier], how are you?" on my wall.
but if i type "hello @[562372646:lionel cordier], how are you?" directly in facebook, it works correctly.
what am i doing wrong?
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/