Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can retrieve the birthdays of your (or the user's) facebook friends with a single fql request.</p> <p>You can read about fql here: <a href="http://developers.facebook.com/docs/reference/fql/" rel="noreferrer">http://developers.facebook.com/docs/reference/fql/</a></p> <p>But here's some code for reference (this code is in a class defined to be a FBSessionDelegate, and FBRequestDelegate)</p> <pre><code>- (void)request:(FBRequest *)request didLoad:(id)result { // result is a NSDictionary of your friends and their birthdays! } - (void)fbDidLogin { //some best practice boiler plate code for storing important stuff from fb NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"]; [defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"]; [defaults synchronize]; //now load all my friend's birthdays NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"select birthday, name, uid, pic_square from user where uid in (select uid2 from friend where uid1=me()) order by name", @"query", nil]; [self.facebook requestWithMethodName: @"fql.query" andParams: params andHttpMethod: @"POST" andDelegate: self]; } - (void) loginWithFacebook { self.facebook = [[[Facebook alloc] initWithAppId:@"&lt;your app id here&gt;" andDelegate:self] autorelease]; //IMPORTANT - you need to ask for permission for friend's birthdays [facebook authorize:[NSArray arrayWithObject:@"friends_birthday"]]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload