如何检索Facebook好友群组名称?

时间:2013-05-10 04:44:50

标签: ios facebook

Facebook SDK 3. +有requestForMyFriends,并返回FBGraphUser但它没有组名属性,有没有办法让所有组都属于用户?

1 个答案:

答案 0 :(得分:2)

您可以使用FB Open Graph和SLRequests轻松获取所有用户组。确保您已经过身份验证,然后按照以下方式拨打电话:

NSURL *groups = [NSURL URLWithString:@"https://graph.facebook.com/me/groups"];

SLRequest *retrieveGroups = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:groups parameters:nil];

[retrieveGroups performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error)
{
//responseData contains your groups 
}];