Created
April 5, 2015 21:14
-
-
Save matthijsotterloo/2955e2c0f90f579497f9 to your computer and use it in GitHub Desktop.
Facebook friends attending
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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