2

Possible Duplicate:
How to get Facebook user's friends information using JavaScript SDK

I want to show my Facebook friends' birthdays using the Facebook API but I don't know how to use it. How can I do that?

First Facebook login, then friend's birthday..

Please don't give me Facebook developer address my English is not good, please give me a example

Community
  • 1
  • 1
PsyGnosis
  • 1,489
  • 6
  • 21
  • 28
  • 4
    Well then you should improve your English and try writing some code. We are not going to write your code but rather help you with specific problems. – ThiefMaster Apr 17 '11 at 16:13

2 Answers2

1

Just get the friends_birthday permission and then query:

SELECT uid,name,birthday FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())

The inner query will get all the friends' ids and the outer will get their ids, names and birthday dates.

ifaour
  • 38,035
  • 12
  • 72
  • 79
0

I haven't tried this, but after reading the API docs it seems once the user authorizes the app, you will need to ask for their list of friends:

FB.api('/me/friends', function(response) {  // your JavaScript here });

You can then pull bithdays of each friend by calling:

FB.api('/USER_ID/birthday', function(response) { // Display birthdays here });

Remember you need explicit permission from the user for this item.

More info:

http://developers.facebook.com/docs/reference/api/user/ http://developers.facebook.com/blog/post/481

Hope that helps!

Ciaran Archer
  • 12,316
  • 9
  • 38
  • 55