从Facebook获取我的朋友列表 - iOS

时间:2014-02-26 14:55:23

标签: ios iphone facebook-graph-api

我正在尝试使用以下代码在facebook中获取我的朋友列表:

  [FBRequestConnection startWithGraphPath:@"/me/friendlists"
                                 parameters:nil
                                 HTTPMethod:@"GET"
                          completionHandler:^(
                                              FBRequestConnection *connection,
                                              id result,
                                              NSError *error
                                              ) {
                              NSLog(@"result is %@",result);
                          }];

但结果是:

data =     (
            {
        id = 200157003455826;
        "list_type" = acquaintances;
        name = Acquaintances;
    },
            {
        id = 115504338587760;
        "list_type" = family;
        name = Family;
    },
            {
        id = 115504328587761;
        "list_type" = "close_friends";
        name = "Close Friends";
    }
);

如何获取所有Facebook好友列表?

1 个答案:

答案 0 :(得分:0)

我用这段代码解决了我的问题:

  [FBRequestConnection startWithGraphPath:@"/me/friends"
                                 parameters:nil
                                 HTTPMethod:@"GET"
                          completionHandler:^(
                                              FBRequestConnection *connection,
                                              id result,
                                              NSError *error
                                              ) {
                              NSLog(@"result is %@",result);
                          }];

而不是其他