iphone - 如何提取安装了您的 iOS 应用程序的 Facebook 好友

标签 iphone ios facebook-graph-api

 NSArray* friends = [result objectForKey:@"data"] ;



NSLog(@"Found: %i friends", friends.count);
         for (NSDictionary<FBGraphUser>* friend in friends) {
    NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);



    // person.firstName = friend.first_name;
   // person.lastName = friend.last_name;
    Contact_Details *person;         
    person = [[Contact_Details alloc] init];
    person.emails = [[NSMutableArray alloc] init];

    person.fullName = friend.name;
    email2=friend.id;


    [person.emails addObject:email2];
    [GathrUsers addObject:person];              //gathrusers is mutualable array of objects

这里的列表显示了 facebook 好友的名字,但我需要那些没有使用 FBFriendPicker 安装应用程序的人的名字

最佳答案

试试这个

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

在您的 FBRequestDelegate 方法中

- (void)request:(FBRequest *)request didLoad:(id)result {

    NSLog(@"App Installed Friends: %@,%d",[result description],[result count]);

 }

关于iphone - 如何提取安装了您的 iOS 应用程序的 Facebook 好友,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15758182/

相关文章:

iphone - 适用于 iOS 的 FacebookSDK,Facebook 登录无法返回我的 iOS 应用程序

iphone - 如何实现可以在背景上滚动的 UITableView

iphone - Xcode build设置

使用 CloudFlare 页面规则重定向到 HTTPS 时 Facebook 共享调试器出现错误

iphone - 我对 UINavigationController 的使用有什么问题?

ios - 为 ios 模拟器编译并运行 UITest 2 次

iphone - 将 Funambol SDK 集成到我的 iOS 应用程序时出错

ios - 为什么在此 IOS 代码中仍会拾取双击?

spring-boot - 尝试访问节点类型(用户)上不存在的字段(上下文)

facebook - Facebook API 是否允许自动更改旧帖子的可见性?