简体   繁体   English

获取用户的Facebook朋友

[英]Fetching facebook friends of user

I am trying to fetch facebook friend list of the user but it returning only count of the friends.Bellow is my code .Is there anything wrong in this code? 我正在尝试获取用户的Facebook朋友列表,但它仅返回朋友的数量。以下是我的代码。此代码有什么问题吗?

-(void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user
{
[FBRequestConnection startWithGraphPath:@"/me/friends"
                                     parameters:nil
                                     HTTPMethod:@"GET"
                              completionHandler:^(
                                                  FBRequestConnection *connection,
                                                  id result,
                                                  NSError *error
                                                  ) {
                                  NSLog(@"me/friends result=%@",result);

                                  NSLog(@"me/friends error = %@", error.description);

                                  NSArray *friendList = [result objectForKey:@"data"];
                                  //[m_allFriends addObjectsFromArray: friendList];
                              }];
}

When you registered your app to facebook. 当您将应用程序注册到Facebook时。 Facebook provide only three permission , these permission is by default approved Facebook仅提供三个权限,这些权限在默认情况下为已批准

user_friends Provides access to a person's list of friends that also use your app. user_friends提供对也使用您的应用程序的朋友列表的访问权限。 This permission is approved by default. 默认情况下会批准此权限。

according to this you can get only those friend who use your app. 据此,您只能获得那些使用您的应用程序的朋友。 check this link https://developers.facebook.com/docs/graph-api/reference/v2.3/user/friends 检查此链接https://developers.facebook.com/docs/graph-api/reference/v2.3/user/friends

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM