I am trying to get a user zip using facebook API. I use the following code for this. The 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 authenticated. $user_profile = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); $user = null; }
Here I get an array of $ user_profile, it has all the information, other information about the zip code. But I gave permission for this. Is there any way to get the zip code from facebook.
source share