Filter the friend returned by FBFriendPickerViewController in new Facebook 3.0

I have an Facebook app on http://developer.facebook.com of type "Native iOS" which is connected to the actual iOS app using the new Facebook iOS SDK 3.0.

How can I know if the multiple people that already install the the app and authorize the Facebook app too so I can put them in some list, but this not my question because I know that there is a field called "installed" that return true when the user install the app.

So if I want to filter the returned friend by the FBFriendPickerViewController based on if the user use the app, so how I can use the installed field or something else to filter the friends.

Note: I know where to filter the friend (*) all I need is the field or the property that I need to check to make sure the user is install my app.

*- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker shouldIncludeUser:(id<FBGraphUser>)user

Answers


I found a way to do this :

I create a method that send an FQL to those I need (for example my friends that they are male)

and then compare those returned by this request with the already exists by the FBFriendPickerViewController using the method :

- (BOOL)friendPickerViewController:(FBFriendPickerViewController *)friendPicker shouldIncludeUser:(id<FBGraphUser>)user

for the request :

NSDictionary *queryParam = [NSDictionary dictionaryWithObjectsAndKeys:@"query", @"q", nil];
[FBRequestConnection startWithGraphPath:@"/fql" parameters:queryParam HTTPMethod:@"GET" 
completionHandler:^(FBRequestConnection *connection,  id result, NSError *error) {
             if (error)
             {
                 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oops" message:@"Some thing go wrong !, Try again" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];

                 [alert show];
             }
             else
             {
                 NSArray *friendInfo = (NSArray *) [result objectForKey:@"data"];

                 for(int i = 0; i < [friendInfo count]; i++)
                 {
                     [self.friendsNames addObject:[[friendInfo objectAtIndex:i] objectForKey:@"name"]];
                 }
             }     
 }];

As you see I have an NSArray that store the filtered friend, the next step is to compare them in the delegate method above.

Hope you find it useful.


Need Your Help

How do you implement a reusable named pipe listener that runs asynchronously?

.net asynchronous named-pipes reusability

I can't find a good example of how to create a reusable named pipe listener that runs asynchronously. I can make a reusable listener:

onClick function remove :hover pseudo class

javascript jquery html css

I stole a little jQuery script to make navigation links on the same page scroll smoothly and made minor changes.