I am doing a demo of facebookapp that only wants to get a acces_token from the app. The app is totally client side and i don't have the possibility of server-side.
At this moment I load correctly the javascript sdk asynchronously and init the facebook with this params:
FB.init(
{
appId: 'XXXX', //XXXX is my AppID
// channelUrl: http://bla,
status: true,
cookie: true,
xfbml: true,
oauth: true
});
My problem is that the function:
FB.getLoginStatus(function (response)
{
alert('Check login: ' + response);
console.log("3");
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("Access Token: " + accessToken);
}
else if (response.status === 'not_authorized')
{
// the user is logged in to Facebook,
// but has not authenticated your app
}
else
{
// the user isn't logged in to Facebook.
}
});
no response anything.
Anyone knows why??