response.session.access_token is not working during the facebook connect?
JavaScript SDK and OAuth 2.0 Roadmap
Facebook has updated JavaScript SDK and OAuth 2.0 Roadmap
Due to this reason response.session.access_token is not working
So You have make some changes in your Facebook login Function
FB.login(function(response) {
if(response.session) {
var access_token = response.session.access_token;
FB.api('/me', function(response) {
}
}
}
if(response.session) {
var access_token = response.session.access_token;
FB.api('/me', function(response) {
}
}
}
Your code was like this in facebook login function.
So edit some code and make this problem solved
FB.login(function(response) {
if (response.authResponse) {
var accessToken = response.authResponse.accessToken;
alert(accessToken);
FB.api('/me', function(response) {
}
}
}
if (response.authResponse) {
var accessToken = response.authResponse.accessToken;
alert(accessToken);
FB.api('/me', function(response) {
}
}
}
So you have to change response.session to response.authResponse
and access_token to accessToken
Done
Comments
Post a Comment