FBSDKLoginKit is crashing for unknown reason on iOS11.3 version

六眼飞鱼酱① 提交于 2020-01-13 05:26:27

问题


@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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!