Facebook SDK IOS xcode
This may not be quite on point to your question, but it's at least related. While the instructions from Facebook say to set the button's class to FBSDKButton
, that doesn't work and crashes as you describe above. Setting the button's class to FBSDKLoginButton
seems to work.
i have got the same exact error.
After inspection, it's appear i need in my project : FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit.
If you use cocoapods, this is the line in Podfile :
pod 'FBSDKCoreKit'pod 'FBSDKLoginKit'pod 'FBSDKShareKit'
after pod install
, add this to your bridging header .h file :
#import <FBSDKCoreKit/FBSDKCoreKit.h>#import <FBSDKShareKit/FBSDKShareKit.h>#import <FBSDKLoginKit/FBSDKLoginKit.h>
In your storyboard, define a view with class type FBSDKLoginButton
:
I was facing the same issue. u need to import FBSDKLoginKit in your view controller then use FBSDKLoginButton. find the code snipped
import FBSDKLoginKit
class ViewController: UIViewController {
override func viewDidLoad() { super.viewDidLoad() let fbButton = FBSDKLoginButton() fbButton.center = self.view.center self.view.addSubview(fbButton) // Do any additional setup after loading the view, typically from a nib.}