Facebook iOS SDK 3.0登录教程问题与FBSession [英] Facebook iOS SDK 3.0 Login Tutorial Issue with FBSession
问题描述
我正在尝试将一个应用程序放在一起,其基础是(希望)建立在Facebook iOS SDK 3.0教程上。
I am currently trying to put together an app - with the foundation of it being (hopefully) built on the Facebook iOS SDK 3.0 tutorial.
我的教程以下位于: http://developers.facebook.com/docs / tutorials / ios-sdk-tutorial / authenticate /
我发现在Facebook的各种SDK版本中有一些变化,当涉及到最终版本。
I have found there to be a few changes throughout the various SDK versions from Facebook when it comes to the final release.
然而,在代码编译之前,我有一个最后一个问题:
However I do have one final issue before the code will compile:
没有已知选择器的类方法sessionOpenWithPermissions:completionHandler:'
"No known class method for selector 'sessionOpenWithPermissions:completionHandler:'"
此错误指代以下代码:
- (void)openSession
{
[FBSession sessionOpenWithPermissions:nil completionHandler:
^(FBSession *session, FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
}
当查看Xcode中的FBSession.h文件时,没有提到 sessionOpenWithPermissions
。
When looking at the FBSession.h file in Xcode there is no mention of sessionOpenWithPermissions
.
有人可以帮我吗?我是Objective-C / Xcode的新手,并通过火灾试用学习。
Can anyone please help me with regard to this? I am new to Objective-C/Xcode and am learning via trial by fire.
推荐答案
我遇到同样的问题,我的代码使用以下变更。
I ran into the same issue, got my code working with the below change.
//REPLACE
[FBSession sessionOpenWithPermissions:nil
completionHandler: ^(FBSession *session, FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
//WITH
[FBSession openActiveSessionWithPermissions:nil
allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
[self sessionStateChanged:session state:state error:error];
}];
如果您点击该方法,您将获得有关要传递的参数的更多信息。
openActiveSessionWithPermissions选项
If you alt click on the method you'll get more info on the parameters to pass. openActiveSessionWithPermissions options
这篇关于Facebook iOS SDK 3.0登录教程问题与FBSession的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!