So I finally solved the issue.
The problem was that I didn't test the app when the user is not connected to Facebook. For me the app was not supposed to be used outside Facebook game center (though it's possible) and Facebook probably test this case during app review. Hence none of the following events gets fired:
- auth.statusChange
- auth.authResponseChange
- auth.login
To tackle this problem I make a call to getLoginStatus
, something like this:
FB.getLoginStatus(function (response) {
console.log('[Facebook] getLoginStatus: ' + response.status);
if (response.status !== 'connected' &&
response.status !== 'not_authorized')
{
console.log('[Facebook] not connected');
$('#loginscreen').show();
$('#btn-fb-login').click(function (event) {
event.preventDefault();
FB.login(function (response) {
$('#loginscreen').hide();
start(response);
}, { scope: 'email,publish_actions'});
});
}
});