Reputation: 3171
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.
Upvotes: 4
Views: 14375
Reputation: 1
Direct Access Method:
Log into Facebook under your name. If you need an "Access Token", Click on the Extended Permissions and click the "read_friendlist" check box to get your Access Token and then submit your query. You may need to "Allow" access, so just follow the prompts given. Voila! You now have the usernames for everyone on your Friends List. The "username" parameter in the query will give you the contact email "message to that person" and you append @facebook.com and send them a message. Very simple.
-SAB
Upvotes: 0
Reputation: 1418
First your app should use required permissions like,
user_birthday, friends_birthday, user_location , friends_location...
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
Upvotes: 12