As soon as the user completes the authentication flow on the server side, the user is already authorized for your application, all you need to do is use FB.getLoginStatus :
FB.getLoginStatus(function(response) {
if (response.status === "connected") {
console.log("authResponse: ", response.authResponse);
FB.api("me", function(response2) {
console.log("Hey there " + response2.name);
});
}
else if (response.status === "not_authorized") {
}
else {
}
}
, js sdk , , , , authResponse :
authResponse: {
accessToken: "aaaaaaa",
expiresIn: "bbbbbb",
signedRequest: "cccccc",
userID: "dddddd"
}
facebook , getLoginStatus .
, , , .
:
- -, Javascript SDK
FB.getLoginStatus() : true , FB.init() , , Facebook, authResponse, , , .
, .