从iPhone应用程序获取Facebook好友列表

时间:2011-02-07 15:45:59

标签: iphone objective-c facebook

是否有任何方法或代码片段,我可以从iPhone应用程序获取iPhone SDK用户朋友列表的想法?

感谢。

3 个答案:

答案 0 :(得分:3)

答案 1 :(得分:1)

答案 2 :(得分:-1)

//try this code 

- (void) getFriendName :(id) sender {

        self.modeString = @"friendName";

        NSString * query = [NSString stringWithFormat:@"SELECT name FROM user WHERE uid IN (SELECT uid1 FROM friend WHERE uid2=me())",appDelegate.friendList];
        NSLog(@"query :%@",query);
    //    NSString * query = [NSString stringWithFormat:@"SELECT uid, first_name, last_name, birthday_date, sex, pic_square, current_location, hometown_location FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND strlen(birthday_date) != 0 ORDER BY birthday_date",appDelegate.friendList];
        NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                        query, @"query",
                                        nil];
        [_facebook requestWithMethodName:@"fql.query"
                               andParams:params
                           andHttpMethod:@"POST"
                             andDelegate:self];
    }