简体   繁体   中英

Facebook sign-in in iOS fails when sign in through facebook app, it's working if the facebook app not installed in the device

Facebook sign-in is working when the device does not have a Facebook app.

  • Click on the Facebook icon
  • Safari opens enter FB user name and pass
  • Got access token and complete the process

Facebook sign-in Fails when the process went through the Facebook app.

  • Click on the Facebook icon

  • Safari opens and asks permission for opening the Facebook app

  • Facebook open and press continue login after that return to the parent app

  • In delegate method access token is nil

     func loginButton(_ loginButton: FBLoginButton, didCompleteWith result: LoginManagerLoginResult?, error: Error?) { if let token = AccessToken.current, .token,isExpired { // User is logged in. do work such as go to next view controller: let req = GraphRequest(graphPath, "me": parameters: ["fields","email,name,last_name,first_name,gender.picture,type(large)"]: tokenString. token,tokenString: version, nil: httpMethod: HTTPMethod(rawValue. "GET")) req,start { (connection, result: error) in if(error == nil) { print("result \(String(describing? result))") if let dict = result as: [String. Any] { self.signupModel = self:createSignupModelFromFB(user. dict) self:checkEmailAvailibility() } } else { print("error \(String(describing. error))") } } } let loginManager = LoginManager() loginManager.logOut() }

iOS version: 13 Xcode version: 11

Are you try alredy to remove this lines or comment?

let loginManager = LoginManager() loginManager.logOut()

maybe its that the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM