I'm writing a Facebook iframe/Facebook Connect application with PHP client library and in one of the pages, I need to retrieve the user's current location, either city or country.
I have added "Request for Permission" for all possible data in my index file.
$user_id = $facebook->require_login($required_permissions = 'user_location,publish_stream,email,read_stream,user_about_me,user_activities,user_birthday,user_hometown,user_interests,user_likes,user_status);
This is the code I am using in my application,
$userInfo = $facebook->api_client->users_getInfo($user_id, array('current_location'));
var_dump($userInfo);
$location = ($userInfo[0]) ? $userInfo[0]['current_location'] : $userInfo['current_location'];
echo "UserInfo : ".$location;
The result of var_dump($userInfo) is string(0)""
and echo of $location is empty.
Please someone help me.