I am creating a facebook application in an iframe. The page basically works, but I want to use the username currently registered on the page for custom posts, etc.
I load the FB library as follows:
<div id="fb-root"></div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" >
FB.init({
appId : '106832082707477',
status : true,
cookie : true,
xfbml : true
});
FB.getLoginStatus(function(response) {console.log("FB.getLoginStatus=" + response.status)});
</script>
I currently have a page in sandbox mode, but two out of 4 people get FB.getLoginStatus = Connected, and the other two get FB.getLoginStatus = NotConnected.
For those who are not connected, when I call FB.api, it returns 'undefined' as the username:
function testFBLoggedIn() {
FB.api('/me', function(response) {
alert(response.first_name);
}
}
, , - , _, last_name . , , .
- - , facebook, ?
.