I am trying to build a web app which use Facebook graph API for login and retrieve User ID, Name and Friend List. I am able to get Name and a ID which is not actual profile id. Only my app recognize that ID. This code is for login button:
<fb:login-button
id="fb-btn"
scope="public_profile,email,user_friends"
onlogin="checkLoginState();">
</fb:login-button>
And this is used for API call:
function testAPI() {
FB.api('me?fields=id,name,email,friends', function(response){
if(response && !response.error){
console.log(response);
}
})
}
I am getting user id: "10211305857749793" and empty friend list. But actual user id is 1460690872. How to get actual profile id.
This is the output I am getting:
{id: "10211305857749793", name: "Atul Krishna", email: "atul.krishan1994@gmail.com", friends: {…}} friends:{data: Array(0), summary: {…}}