I am not familiar with using Facebook Javascript SDK. My story is when I access to the website It displays all my friends(pic and name) on a webpage. I registered Facebook API and App ID I put website URL as http://localhost:81/ because I am testing my own local machine. Do you have any good example website or good examples? Please share with me Thank you.
First your app should use required permissions like,
user_birthday, friends_birthday, user_location , friends_location...
( for more permissions)
Get info about current user:
FB.api('/me', function(response) {
// Stuff here
});
Get info about current user's friends:
FB.api('/me/friends', function(response) {
// Stuff here
});
you will get the response like,
{data: [{id: "FRIEND1_ID", name: "FRIEND1_NAME"}, {id: "FRIEND2_ID", name: "FRIEND2_NAME"}]....}
If you want get some more properties of your friends, use FIELDS
parameter, like
FB.api('/me/friends', {fields: 'name,id,location,birthday'}, function(response) {
// Stuff here
});
If want to get individual user's friend info:
FB.api('/FRIEND1_ID', function(response) {
// Stuff here
});
Try this Example Site
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With