Facebook好友选择器只显示使用app-IOS的朋友

时间:2014-08-25 11:42:14

标签: ios facebook facebook-graph-api

我想和所有朋友一起制作一个FBFriendPickerViewController,我知道还有其他关于它的帖子,但答案是我在请求中输入'taggable_friends'而不是朋友,但结果与'taggable_friends'相同和'朋友'一样。 FBFriendPickerViewController仅包含已安装应用程序的朋友。 这是我的代码:

 [FBSession openActiveSessionWithReadPermissions:
 [NSArray arrayWithObjects:@"user_friends",nil] allowLoginUI:YES
                              completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
                                  //YOUR CODE
                                  FBRequest* friendsRequest = [FBRequest requestWithGraphPath:@"me/taggable_friends?fields=picture,name,username,location,first_name,last_name" parameters:nil HTTPMethod:@"GET"];


                                  [friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary* result, NSError *error) {
                                      //store result into facebookFriendsArray
                                      facebookFriendsArray = [result objectForKey:@"data"];
                                      [self.friendPickerController loadData];
                                  }];

                              }];

if (self.friendPickerController == nil) {
    // Create friend picker, and get data loaded into it.
    self.friendPickerController = [[FBFriendPickerViewController alloc] init];
    self.friendPickerController.title = @"Pick Friends";
    self.friendPickerController.delegate = self;
}

[self.friendPickerController loadData];
[self.friendPickerController clearSelection];

[self presentViewController:self.friendPickerController animated:YES completion:nil];

0 个答案:

没有答案