Unable to get birthday of facebook user in the facebook app.

Hi,

I have created a app in facebook and that app reuires user to login through facebook account.
I am using graph api to get logged-in user information like fb_id,birthday and gender  from the face book.
I am able to get the gender and fb_id but birthday is not coming in the jason object .
However for a one or two users i am able to get the birthday but for others it is not received.

My concern is :
1. Is there any face book setting needs to be done by the user itself so that facebook app can receive the birthday?
2. Do i need to make modification in the app setting? If yes then what setting i need to change.

Array received

{"id":"100002661885131","name":"Raj Johnson","first_name":"Raj","last_name":"Johnson","link":"https:\/\/www.facebook.com\/profile.php?id=100002661885131","hometown":{"id":"110669992287629","name":"Bangalore, Karnataka"},"location":{"id":"106517799384578","name":"Bangalore, India"},
"gender":"male","timezone":5.5,"locale":"en_US","verified":true,"updated_time":"2013-09-26T07:44:30+0000"}

code

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $token_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$response = curl_exec($ch);
curl_close($ch);
parse_str($response, $pram);
$graph_url = Configure::read(https://graph.facebook.com/me?access_token=');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $graph_url . $pram['access_token']);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$user_fb_details = curl_exec($ch);
curl_close($ch);
$this->Session->write('App.UserInfo', $user_fb_details);

In model

$userinfoObj = json_decode(ClassRegistry::init('CakeSession')->read("App.UserInfo"));
$fb_id = $userinfoObj->id;
$fb_birthday = $userinfoObj->birthday; --It is coming as null

Please help
RockingAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
DOB is a private thing, and if they have not made it public then you cannot get it.
0
RockingAuthor Commented:
i have made public then also not getting.
Steps
Edit Profile->basic information ->birthday ->public

Is there any other setting for making b'day public?
0
GaryCommented:
That's your own DOB, are you not able to get your own DOB?
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

RockingAuthor Commented:
yes
0
GaryCommented:
Yes you can get your DOB or yes you can't get you DOB :o/
0
RockingAuthor Commented:
i can't get my birthday.
0
GaryCommented:
Test here to see if you can get direct in FB
https://developers.facebook.com/tools/explorer?method=GET&path=me/friends?fields=birthday,name

Are you opted out of FB apps?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RockingAuthor Commented:
Test here to see if you can get direct in FB
https://developers.facebook.com/tools/explorer?method=GET&path=me/friends?fields=birthday,name

since i only need my birthday i changed the url as below
Test here to see if you can get direct in FB
https://developers.facebook.com/tools/explorer?method=GET&path=me?fields=birthday

yes i am able to get the birthday.


Are you opted out of FB apps?
Pls explain a little more
0
GaryCommented:
I'm not overly familiar with the FB API.
Two reasons you cannot get the DOB, you are accessing it remotely (not within FB) or your app is not authorised to access the info i.e. the users have not granted your app access.
0
RockingAuthor Commented:
Two reasons you cannot get the DOB,

you are accessing it remotely (not within FB)
>> App is opened in the facebook window,if user directly access the app url it redirects to fb login page and once authenticated the app is opened in the same tab.
As per above functionality i think it is not accessed remotely

or your app is not authorised to access the info i.e. the users have not granted your app access.
How can i make app authorised to access the info?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.