2013-01-11 74 views
-1

在我的应用程序中,我通过使用FBFriendPickerViewController登录用户的朋友列表,如果我选择列表中的任何一个,我可以显示他的详细信息,如姓名,身份证,位置等我的问题是,通过使用这些细节,我怎么能让他(FBFriendPickerViewController中的朋友)在我的应用程序中的朋友列表?如何在IOS中获取登录用户的朋友的朋友列表6

回答

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 
      } 
+0

会是工作SDK 3.1? – ggg

+0

它不适用于3.1 SDK。 – ggg

相关问题