iPhone 应用程序 : find the Facebook friends who has installed app into their device

标签 iphone objective-c ios facebook facebook-graph-api

我正在实现 iPhone 应用程序,我想从 Facebook 获取已在其设备上安装该应用程序的 friend 列表。

为此,我发送如下请求:

  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];

但作为回应,它只给我已将应用程序安装到其设备中的用户的 Facebook id:

   xxxxxxxxxxxxxx1,
   xxxxxxxxxxxxxx2,
   xxxxxxxxxxxxxx3

我怎样才能收到所有正在使用应用程序的 friend 的如下回复?

  {
    "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";         
 }

我怎样才能做到这一点?

最佳答案

使用 FQL 我可以在查询中使用参数 is_app_use 获得响应

  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];

关于iPhone 应用程序 : find the Facebook friends who has installed app into their device,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10717285/

相关文章:

ios - 矩形和圆形碰撞检测

iphone - cocoa iPhone 递归数组

javascript - 在 iphone 的 safari 中打开时记录网站的控制台消息

iphone - 使用 NSDictionary 访问问题

iphone - 为什么 NSUserDefaults 返回一个释放的字符串? (更新#2)

ios - CoreData和MagicalRecord-仅在应用用户点击时,我应该如何正确处理更新数据?

objective-c - NS_ENUM 与枚举

ios - 如何防止ipa文件/iphone应用程序被破解到源码?

iphone - UITextField设置backgroundcolor隐藏阴影

iphone - 我需要删除导致崩溃的 IBOUTLET 连接