简体   繁体   中英

iPhone app: find the Facebook friends who has installed app into their device

I am implementing iPhone app where I want to fetch list of friends from Facebook who has already installed the app into their devices.

For that I'm sending request as below:

  AppDelegate *appDelegate=[[UIApplication sharedApplication] delegate];
   NSMutableDictionary*params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"picture,id,name,link,gender,last_name,first_name",@"fields", nil];
   [[appDelegate facebook] requestWithMethodName:@"friends.getAppUsers" andParams:params andHttpMethod:@"GET" andDelegate:self];

but in response it is giving me only Facebook id of users who has installed app into their device as:

   xxxxxxxxxxxxxx1,
   xxxxxxxxxxxxxx2,
   xxxxxxxxxxxxxx3

How can I receive response as below for all friends who are using app?

  {
    "first_name" = abc;
    gender = male;
    id = 10000xxxxxxxxxxxx;
    "last_name" = xyz;
    link = "http://www.facebook.com/profile.php?id=10000xxxxxxxxxxxx";
    name = "abc xyz";
    picture = "http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yo/r/UlIqmHJn-SK.gif";         
 }

How can I achieve that?

using FQL I could get response with parameter is_app_use in Query

  NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                @"select uid, name,pic_small, is_app_user from user where uid in (select uid2 from friend where uid1=me()) and is_app_user=1", @"query",
                                nil];
[[APPDELEGATE facebook ]   requestWithMethodName: @"fql.query"
                                       andParams: params
                                   andHttpMethod: @"POST"
                                     andDelegate: self];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM