gpt4 book ai didi

ios - Facebook iOS 选择 friend 表空白

转载 作者:行者123 更新时间:2023-11-29 13:17:34 25 4
gpt4 key购买 nike

我正在尝试将“选择 friend ”添加到我的 iOS 应用程序。我设置了登录 View 。登录后,我打开好友选择器,但它是空白的。我看到带有完成和取消按钮的表格,但表格中没有加载 friend 。

- (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];

}

最佳答案

在打开好友选择器 Controller 之前,通过调用以下命令确保您的 Facebook session 处于事件状态:

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
}];
}

关于ios - Facebook iOS 选择 friend 表空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15314154/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com