Search code examples
facebookfacebook-graph-api

Birthday field not returning data


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);          

    }

}

Solution

  • 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.