问题
@IBAction func didTapLogainAction(_ sender: Any) {
let fbLoginManager : FBSDKLoginManager = FBSDKLoginManager()
fbLoginManager.logIn(withReadPermissions: ["email"], from: self) { (result, error) in
if (error == nil){
let fbloginresult : FBSDKLoginManagerLoginResult = result!
if fbloginresult.grantedPermissions != nil {
if(fbloginresult.grantedPermissions.contains("email")) {
if((FBSDKAccessToken.current()) != nil){
FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, first_name, last_name, picture.type(large), email"]).start(completionHandler: { (connection, result, error) -> Void in
if (error == nil){
let dict = result as! [String : AnyObject]
FBSDKLoginManager().logOut()
}
})
}
}
}
}
}
}
Facebook login, when i'm press continue from facebook interface, it crashing on my iOS11.3 version. it quitely working good in ios11.4 and iOS11.03 lowers versions.
回答1:
It got resolved by the Facebook developer team. Meanwhile, we have to use the following snippet for iOS11.3. If older Methods also will work i think.
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(app, open: url, options: options)
}
来源:https://stackoverflow.com/questions/49823007/fbsdkloginkit-is-crashing-for-unknown-reason-on-ios11-3-version