Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook API未使用好友的生日权限返回好友的生日 $fb_friends=$f1->getFacebookFriends(); $fb_friends_Count=$f1->displayFriendCount(数组('users'=>$fb_friends,'nb_display'=>1)); //获取当前日期 $date_now=getdate(); $current_day=$date_now['mday']; $current_month=$date_now['mon']; $current_year=$date_now['year']; //获取朋友的详细信息 对于($u=0;$u xxxxxxx[name]=>Joye Tanay Lipata[first_name]=>Joye[middle_name]=>Tanay[last_name]=>Lipata[link]=>http://www.facebook.com/joye.lipata [username]=>joye.lipata[gender]=>female[locale]=>en_-US)_Facebook - Fatal编程技术网

Facebook API未使用好友的生日权限返回好友的生日 $fb_friends=$f1->getFacebookFriends(); $fb_friends_Count=$f1->displayFriendCount(数组('users'=>$fb_friends,'nb_display'=>1)); //获取当前日期 $date_now=getdate(); $current_day=$date_now['mday']; $current_month=$date_now['mon']; $current_year=$date_now['year']; //获取朋友的详细信息 对于($u=0;$u xxxxxxx[name]=>Joye Tanay Lipata[first_name]=>Joye[middle_name]=>Tanay[last_name]=>Lipata[link]=>http://www.facebook.com/joye.lipata [username]=>joye.lipata[gender]=>female[locale]=>en_-US)

Facebook API未使用好友的生日权限返回好友的生日 $fb_friends=$f1->getFacebookFriends(); $fb_friends_Count=$f1->displayFriendCount(数组('users'=>$fb_friends,'nb_display'=>1)); //获取当前日期 $date_now=getdate(); $current_day=$date_now['mday']; $current_month=$date_now['mon']; $current_year=$date_now['year']; //获取朋友的详细信息 对于($u=0;$u xxxxxxx[name]=>Joye Tanay Lipata[first_name]=>Joye[middle_name]=>Tanay[last_name]=>Lipata[link]=>http://www.facebook.com/joye.lipata [username]=>joye.lipata[gender]=>female[locale]=>en_-US),facebook,Facebook,生日未显示。必须在图形api调用中使用当前访问令牌参数 $fb_friends = $f1->getFacebookFriends(); $fb_friends_Count = $f1->displayFriendCount(array('users'=>$fb_friends, 'nb_display'=>1)); //get current date $date_now=getdate(); $current_day=$date_now['mday']; $curr

生日未显示。

必须在图形api调用中使用当前访问令牌参数

$fb_friends = $f1->getFacebookFriends();
$fb_friends_Count = $f1->displayFriendCount(array('users'=>$fb_friends, 'nb_display'=>1));

//get current date
$date_now=getdate();
$current_day=$date_now['mday'];
$current_month=$date_now['mon'];
$current_year=$date_now['year'];

//get friends' details  
for($u=0; $u<$fb_friends_Count; $u++) {
    $fb_friends_id=$fb_friends[$u]['id'];
    $friend_profile1="http://graph.facebook.com/".$fb_friends_id."/";
    $friend_profile = @file_get_contents($friend_profile1);
    $friend_profile = json_decode($friend_profile,true);    
    $gender=$friend_profile['gender'];
    print_r($friend_profile);

    //get birthday
    $birthday=$friend_profile['birthday'];

我的函数中已经有了它:函数getFacebookFriends($criteria=''){$name=$criteria['name'];if($name='')$name='me';$url=';$content=@file_get_contents($url,0,null,null);$content=json_decode($content,true);$users=$this->formatFacebookUsers($content);return$users;}它只是用于获取用户朋友。在for循环中,您正在发出另一个graph api请求,该请求没有访问令牌参数。使用access_token参数所有图形api调用..我使用它来获取我朋友的性别..并且性别正确显示。。但是为什么生日没有出现呢?我不知道这是否是许可问题。。但是我已经在我的应用程序和范围中设置了用户的生日和朋友的生日…“graph.facebook.com/$fb\u friends\u id”和“graph.facebook.com/$fb\u friends\u id/?access\u token=$access\u token”会给出不同的结果。如果没有access_令牌,您只能获取用户公共数据(如性别),但使用access_令牌参数,您可以获取所有您可以使用权限获取的信息。因此,在for循环之前,获取访问令牌并分配一个变量,然后在for循环中,在graph api url之后添加访问令牌参数(即graph.facebook.com/$userId/?access\u token=$access\u token)…我在getFacebookFriends函数$url='.$name./friends?access\u token='.$this->getAccessToken();这不起作用吗?这是针对你查询的所有朋友,还是只针对特定的一次?如果用户已设置其隐私设置,使其生日不会与朋友正在使用的应用共享,则您将无法获得此类朋友的生日值。这适用于我的所有朋友。。我不知道为什么,但是阵列上没有显示生日。他们可能在隐藏他们的生日信息。
$friend_profile1 = "http://graph.facebook.com/".$fb_friends_id."/?access_token=".$access_token;