Skip to content

Instantly share code, notes, and snippets.

@matthijsotterloo
Created April 5, 2015 21:14
Show Gist options
  • Save matthijsotterloo/2955e2c0f90f579497f9 to your computer and use it in GitHub Desktop.
Save matthijsotterloo/2955e2c0f90f579497f9 to your computer and use it in GitHub Desktop.
Facebook friends attending
-(void)getFriendsAttending{
NSLog(@"getting friends");
NSString *fql = [NSString stringWithFormat:@"SELECT uid, name, pic FROM user WHERE uid IN (SELECT uid FROM event_member WHERE eid = %@ AND rsvp_status = 'attending' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me()))", fbID];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObject:fql forKey:@"q"];
[FBRequestConnection startWithGraphPath:@"/fql"
parameters:params
HTTPMethod:@"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
if (error) {
NSLog(@"Error: %@", [error localizedDescription]);
} else {
NSLog(@"Friends at event %@: %@", fbID, result);
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment