Facebook iOS选择好友表空白 [英] Facebook iOS Select Friends Table Blank

查看:78
本文介绍了Facebook iOS选择好友表空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将选择朋友"添加到我的iOS应用中.我设置了登录视图.登录后,我打开朋友选择器,但它变成空白.我看到带有完成和取消按钮的表,但是表中没有加载任何朋友.

I am trying to add the "select friends" to my iOS app. I set up the login view. Once I login I open the friend picker but it comes up blank. I see the table with the done and cancel buttons but there are no friends loaded into the table.

- (IBAction)selectFriendsButtonAction:(id)sender {
    if (self.friendPickerController == nil) {
        // Create friend picker, and get data loaded into it.
        self.friendPickerController = [[FBFriendPickerViewController alloc] init];
        self.friendPickerController.title = @"Select Friends";
        self.friendPickerController.delegate = self;
    }
    [self.friendPickerController loadData];
    [self.friendPickerController clearSelection];
    [self presentViewController:self.friendPickerController animated:YES completion:nil];

}

推荐答案

在打开好友选择器控制器之前,请通过以下操作确保您的Facebook会话处于活动状态:

Prior to opening the friend picker controller ensure your Facebook session is active by calling this:

if (!FBSession.activeSession.isOpen) {
    // if the session is closed, then we open it here, and establish a handler for state changes
    [FBSession.activeSession openWithCompletionHandler:^(FBSession *session,
                                                         FBSessionState state,
                                                         NSError *error) {
        // Handle error
    }];
}

这篇关于Facebook iOS选择好友表空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆