开发者

Check isfriend using facebook Graph API?

开发者 https://www.devze.com 2023-03-13 03:53 出处:网络
I got a user ID of my friend, at some time he remove开发者_如何学运维 me from my friend list, how can i check using API , whether the specific ID is my friend or not.

I got a user ID of my friend, at some time he remove开发者_如何学运维 me from my friend list, how can i check using API , whether the specific ID is my friend or not. Thanks


i solved by running this fql

$fql_areFriends = "SELECT uid1, uid2 FROM friend WHERE uid1=$user_Id AND uid2=[USER_ID_OF_THE_FRIEND]";

  $friends       = $client->api(array(
                  'method'       => 'fql.query',
                  'access_token' => $user_access_token,
                  'query'        => $fql_areFriends,
                ));

if($friends!=null){
echo 'You Are Connected to friend
}
else{
echo 'You Are Not Connected to friend

}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号