Tag: Swift fbsdk

Facebook SDK 4.7loginerror handling

我添加了FBSDK 4.7到我的swift应用程序,当它打开safari视图控制器login,我尝试点击“完成”,而不input任何东西到电子邮件/密码字段,应用程序中断。 它吐出"fatal error: unexpectedly found nil while unwrapping an Optional value" 我如何处理这个错误? 当前login码: if let fbLoginManager : FBSDKLoginManager = FBSDKLoginManager(){ fbLoginManager.logInWithReadPermissions(["email"],fromViewController:self, handler:{(result:FBSDKLoginManagerLoginResult!,error:NSError!) -> Void in if (error == nil){ let fbloginresult : FBSDKLoginManagerLoginResult = result if(fbloginresult.grantedPermissions.contains("email")) { print("Logged in successfully") self.getFBUserData() //fbLoginManager.logOut() } } else{ print("HELPPPPPPPPPP") } }) }