我已登录,我有访问令牌。我有应用程序的授权。
我想检索正在使用此应用程序(特定)应用程序的用户朋友。如果我在浏览器中使用 fql 和 access_token 运行 URL,那么这会给我准确的结果..但是当使用 php 代码运行时......没有结果..
$userFrndAppUser = null;
$c2 = curl_init();
curl_setopt($c2, CURLOPT_URL, "https://graph.facebook.com/fql?q=SELECT uid,name, is_app_user FROM user WHERE uid IN(SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1&access_token=".$access_token);
curl_setopt($c2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c2, CURLOPT_SSL_VERIFYHOST, false);
$userFrndAppUser = json_decode(curl_exec($c2));
curl_close($c2);
$userFrndAppUser = object2Array($userFrndAppUser);
echo "<br>User's friend which are using this app..";
print_r($userFrndAppUser);
function object2Array($d){
if (is_object($d)){
$d = get_object_vars($d);
}
if (is_array($d))
{
return array_map(__FUNCTION__, $d);
}
else
{
return $d;
}
}