生日字段不返回数据

发布于 2024-10-12 12:11:44 字数 1135 浏览 2 评论 0原文

基本上我在这里有两个问题:

  1. 一旦用户在 fbconnect 上授予了 Facebook 应用程序的权限,该应用程序是否可以随时发布 Facebook 用户的墙?

等他们已经从 Facebook 注销后怎么样?

应用程序所有者是否仍然有权在他们的墙上发布帖子?还是需要等到第二次登录facebook connect才可以重新获取信息?

  1. 不知何故,我所有朋友的生日字段都变成空的。

我正在使用 github 上的最新 php sdk。

$friends    =   $facebook->api('/me/friends');
$_SESSION['fb_user_friends'] = $friends;    

foreach ($friends as $key=>$value) 
{
    echo '<br>';

    foreach ($value as $fkey=>$fvalue) 
    {

        //all the query return values, except birthday and birthday_date field
        //birthday and birthday_date field totally don't have any friend's DOB appearing, all empty.
        //wonder why    

            $fql    =   "SELECT uid, first_name, last_name, name, birthday, birthday_date FROM user WHERE uid=".$fvalue[id];
            $param  =   array(
                'method'    => 'fql.query',
                'query'     => $fql,
                'callback'  => ''
            );
            $userDetails   =   $facebook->api($param);
        print_r($userDetails);          

    }

}

Basically I got 2 question here:

  1. once the user given permission to a facebook application at fbconnect, is it anytime the application can post the fb user's wall?

How about later when they logout from facebook already?

Does application owner still have the permission to like post to their wall? Or need to wait till they login to facebook connect the second time only can re-access the information?

  1. Somehow the birthday field for all my friends are returning as empty.

I am using latest php sdk from github.

$friends    =   $facebook->api('/me/friends');
$_SESSION['fb_user_friends'] = $friends;    

foreach ($friends as $key=>$value) 
{
    echo '<br>';

    foreach ($value as $fkey=>$fvalue) 
    {

        //all the query return values, except birthday and birthday_date field
        //birthday and birthday_date field totally don't have any friend's DOB appearing, all empty.
        //wonder why    

            $fql    =   "SELECT uid, first_name, last_name, name, birthday, birthday_date FROM user WHERE uid=".$fvalue[id];
            $param  =   array(
                'method'    => 'fql.query',
                'query'     => $fql,
                'callback'  => ''
            );
            $userDetails   =   $facebook->api($param);
        print_r($userDetails);          

    }

}

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

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

发布评论

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

评论(2

尤怨 2024-10-19 12:11:44

编辑:这不再是一个准确的答案

- 如果您请求许可,它可以张贴在墙上。

'req_perms' =>   'publish_stream,...

要在注销用户的墙上发帖,您需要另一个权限“offline_access”。所有权限:http://developers.facebook.com/docs/authentication/permissions

-生日。我也有同样的经历。生日有时为空,因为用户没有提供它或将安全性设置为高并且应用程序无法请求它。在注册您的应用程序时,您还必须请求“friends_birthday”许可。

EDIT: this is no longer an accurate answer

-It can post on the wall if you asked for that permission.

'req_perms' =>   'publish_stream,...

To post on wall of loged out user you need another permission "offline_access". All permissions: http://developers.facebook.com/docs/authentication/permissions

-Birthday. I experienced the same. Birthday sometimes empty because user didn't provided it or set the security high and apps can't ask for it. And you have to ask for 'friends_birthday' permission too at registering to your app.

嘦怹 2024-10-19 12:11:44

在应用程序的“设置”中,转到“权限”并启用“用户和用户”。好友权限': 'user_birthday', 'friends_birthday'

in 'settings' on your application, go to 'permissions' and enable 'User & Friend Permissions': 'user_birthday', 'friends_birthday'

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