I am using Facebook login for my iOS app being developed for iOS 8 and onwards. (Latest Facebook SDK is being used)
I have followed all the essential steps described by the Facebook official guide. However, when I click the login button it gives me the following error:
Unknown Error building URL (com.facebook.sdk.core error 3)
I have checked, to look what I might have done wrong, but everything seems as per guide, and I have been stuck here for a day.
Code for FB Login Delegate:
class FBLoginDelegate: NSObject, FBSDKLoginButtonDelegate {
func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!){
if(error == nil){
print("Logged In from Btn")
}else{
print("Error: \(error.localizedDescription)") //Here it gives the error
}
}
}
Code for FB login button:
var fbLoginBtnDelegate = FBLoginDelegate()
let fbBtnWidth = self.view.bounds.width - (self.fbContainerLeftConstraint.constant + self.fbContainerRightConstraint.constant)
let fbLoginButton = FBSDKLoginButton(frame: CGRectMake(0,0,fbBtnWidth,self.fbButtonContainer.bounds.size.height))
self.fbButtonContainer.addSubview(fbLoginButton)
fbLoginButton.readPermissions = ["public_profile", "user_friends", "email", "user_birthday"]
fbLoginButton.delegate = fbLoginBtnDelegate