Чтобы определить статус пользователя facebook онлайн/офлайн, мы используем метод FB.getLoginStatus. Но что означает параметр («ответ») и откуда он берется в приведенном ниже фрагменте кода, что означает ответ параметра в строке «FB.getLoginStatus (функция (ответ)»
FB.getLoginStatus(function(response) {
console.log(response);
if (response.status === 'connected') {
// the user is logged in and has authenticated your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
console.log('User logged in and autenticated');
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
console.log('User logged in, but not autorized');
} else {
// the user isn't logged in to Facebook.
console.log('User not logged in');
}
}, true);