[英]Firebase facebook login for ios (swift) - Use of unresolved indentifier 'FBSDKLoginManager'
I am just trying to run facebook login via Firebase in my ios app. 我只是想在我的ios应用中通过Firebase运行Facebook登录。 I have done everything that is mentioned in Firebase`s ios (swift) guide [ https://www.firebase.com/docs/ios/guide/setup.html] but I am still facing compilation error:
我已经完成了Firebase的ios(交换)指南[ https://www.firebase.com/docs/ios/guide/setup.html]中提到的所有内容,但是我仍然面临编译错误:
Use of unresolved identifier 'FBSDKLoginManager'
使用未解析的标识符“ FBSDKLoginManager”
If I am using: 如果我正在使用:
let facebookLogin = FBSDKLoginManager()
Please note I have downloaded FBSKCoreKit, FBSLoginKit and FBSKShareKit (via cocoapods). 请注意,我已经下载了FBSKCoreKit,FBSLoginKit和FBSKShareKit(通过cocoapods)。
I have also updated my AppDelegate.swift like mentioned in the 7th step from guide above. 我还更新了我的AppDelegate.swift,如上述指南的第7步所述。 I have also updated my ...-Bridging-Header.h file like:
我还更新了我的...- Bridging-Header.h文件,如下所示:
#import <Firebase/Firebase.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
I have also added mentioned frameworks: 我还添加了提到的框架:
libicucore.dylib, libc++.dylib, CFNetwork.framework, Security.framework, SystemConfiguration.framework
libicucore.dylib,libc ++。dylib,CFNetwork.framework,Security.framework,SystemConfiguration.framework
Could you please tell me, what I have missed? 你能告诉我,我错过了什么吗? Thank you for any suggestions.
感谢您的任何建议。
My pod file: 我的pod文件:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
use_frameworks!
target 'MyProject' do
pod 'Alamofire', '~> 1.2'
pod 'AEXML'
pod 'AlecrimCoreData', '~> 3.0'
pod 'Firebase', '>= 2.3.2'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
end
target 'MyProjectTests' do
end
EDIT : Please note I have tried to create new (empty) project, I have added mentioned pods to podfile and I have added mentioned imports to new header bridging file (I have also doublechecked Objective-C bridging header file in Build Setting > Swift Compiler settings). 编辑 :请注意,我尝试创建新的(空)项目,我在Podfile中添加了提到的Pod,并且在新的头文件桥接文件中添加了提到的导入(我还在构建设置> Swift编译器中仔细检查了Objective-C桥接头文件设置)。 I have added problem line
我添加了问题线
let facebookLogin = FBSDKLoginManager()
to viewDidLoad() of sample view controller and I have got the same error. 到示例视图控制器的viewDidLoad(),我有同样的错误。 I am using XCode Version 6.3.2 (6D2105).
我正在使用XCode版本6.3.2(6D2105)。 Could somebodyreproduce the sme issue or am I doing something wrong?
有人可以重现sme问题,还是我做错了什么? Thank you
谢谢
So the solution was that the Firebase documentation is outdated - FB`s SDK is already in swift so there is no necessary to add import to your bridging header file. 因此,解决方案是Firebase文档已过时-FB的SDK已经迅速发布,因此无需将导入添加到桥接头文件中。 Everything you need to do is just add import to your swift file and you are ready to go
您要做的只是将导入添加到您的swift文件中,就可以开始了
import FBSDKCoreKit
import FBSDKShareKit
import FBSDKLoginKit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.