in wich way i could check if facebook profile username is set or not? because i've created a facebook profile for do some test, but it seems that no username is found from profile.
this is my code:
$token = $_POST['token'];
$fb_username;
//get username by GraphApi
$facebook->setAccessToken($token);
$user_id = $facebook->getUser();
try {
$user_profile = $facebook->api('/me', 'GET');
$fb_username = $user_profile['username'];
} catch (FacebookApiException $e) {
sendError("Internal error", 0);
exit(1);
}