after logging in, [facebook requestWithGraphPath: @ "me / friends" andDelegate: self]; // friend data must understand this delegate method.
- (void)request:(FBRequest *)request didLoad:(id)result { if([result isKindOfClass:[NSDictionary class]]) { NSLog(@"dictionary"); result=[result objectForKey:@"data"]; if ([result isKindOfClass:[NSArray class]]) for(int i=0;i<[result count];i++){ NSDictionary *result2=[result objectAtIndex:i]; NSString *result1=[result2 objectForKey:@"id"]; NSLog(@"uid:%@",result1); [uids addObject:result1]; } } }
here, i added all the friends uids to the array. In the same way, u can get names and do any use of GraphApi.
Hope this helps you ...
bharath gangupalli
source share