在我的应用程序中,我通过使用FBFriendPickerViewController登录用户的好友列表,如果我选择该列表中的任何一个,我可以显示他的详细信息,如姓名,ID,位置等。我的问题是通过使用这些详细说明如何在我的应用程序中获取他的(在FBFriendPickerViewController中选择的朋友)朋友列表?。
答案 0 :(得分:0)
试试这个:
NSArray *accounts = [accountStore
accountsWithAccountType:facebookAccountType];
ACAccount *facebookAccount = [accounts lastObject];
NSString *acessToken = [NSString stringWithFormat:@"%@",facebookAccount.credential.oauthToken];
NSDictionary *parameters = @{@"access_token": acessToken};
NSURL *feedURL = [NSURL URLWithString:@"https://graph.facebook.com/me/friends"];
SLRequest *feedRequest = [SLRequest
requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:feedURL
parameters:parameters];
feedRequest.account = facebookAccount;
[feedRequest performRequestWithHandler:^(NSData *responseData,
NSHTTPURLResponse *urlResponse, NSError *error)
{
NSLog(@"%@",[[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
}];
}
else
{
// Handle Failure
}