I am trying to retrieve Zip code of a user using facebook graph API. I am using follow code for that. Code is in php.
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET,
));
$user = $facebook->getUser();
//$login_url = $facebook->getLoginUrl(array( 'scope' => 'email'));
$login_url = $facebook->getLoginUrl(
array(
'scope' => 'email,publish_stream,user_birthday,user_location,user_work_history,user_about_me,user_hometown'
)
);
//get user basic description
//$userInfo = $facebook->api("/$user");
if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
Here I am getting the $user_profile array, It has all information other that zip code. But I gave permission for that. Is there any way to get zip code from facebook.