获得朋友生日?

发布于 2024-12-20 14:55:03 字数 792 浏览 2 评论 0原文

当我使用下面的代码时,它只会为那些与朋友分享他/她生日的人提供生日。然而,即使他们不分享,他们也必须把自己的生日告诉Facebook。我可以获取用户所有朋友的生日吗?我已经获得了 user_birthdayfriends_birthday 权限。

$friends=json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token=AAAEHQWIn3oMBADNX0oRCCUujv0Bx8GCKIWQkTIB6KfJxD001x'));

$friends = (array) $friends;
$friends = $friends['data'];


foreach($friends as $key => $friend)
{
    $friend = (array) $friend;
    $fql    =   "select name, birthday_date from user where uid=".$friend['id'];
    $param  =   array(
                'method'    => 'fql.query',
                'query'     => $fql,
                'callback'  => ''
            );
            $fqlResult   =   $facebook->api($param);
    print_r ($fqlResult);
}

When I use the code below it gives me birthdays only for those who share his/her birthday with their friends. However, even if they don't share they had to give their birthdays to Facebook. Can I get all of the user's friends' birthdays? I already get user_birthday and friends_birthday permissions.

$friends=json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token=AAAEHQWIn3oMBADNX0oRCCUujv0Bx8GCKIWQkTIB6KfJxD001x'));

$friends = (array) $friends;
$friends = $friends['data'];


foreach($friends as $key => $friend)
{
    $friend = (array) $friend;
    $fql    =   "select name, birthday_date from user where uid=".$friend['id'];
    $param  =   array(
                'method'    => 'fql.query',
                'query'     => $fql,
                'callback'  => ''
            );
            $fqlResult   =   $facebook->api($param);
    print_r ($fqlResult);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷︶言冷语的世界 2024-12-27 14:55:03

您只能获取用户的朋友与用户共享的生日。所有其他人都是禁区。在某些情况下,这意味着您可能无法获得年份,具体取决于每个人决定分享的内容。

关于您之前的问题(其他人之前链接到过),我强烈建议您在设计应用程序时要非常小心。请确保它遵循服务条款。您可以在 https://developers.facebook.com/policy/ 找到它们。

You can only get birthday's which have been shared with the user by his/her friends. All others are off limits. In some cases, this means that you may not be able to get the year depending on what each person has decided to share.

In relation to your previous question (which someone else linked to earlier), I would strongly recommend being very careful about what you are designing an app to do. And please make sure that it follows the Terms of Service. You can find them at https://developers.facebook.com/policy/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文