I have implement login with Facebook and its work great on staging and on production also for some user, it's working but for some it not and I am not getting any track or reference, why this is occurring with only some user, whereas I am not able to replicate the error.
Any help or suggestion will be helpful
Fabric crash report last lines
30 CoreFoundation 0x190fc22b8 CFRunLoopRunSpecific + 444
31 GraphicsServices 0x192a76198 GSEventRunModal + 180
32 UIKit 0x1970097fc -[UIApplication _run] + 684
33 UIKit 0x197004534 UIApplicationMain + 208
34 AppName 0x100066f50 main (AppDelegate.swift:64)
35 libdispatch.dylib 0x18ffa55b8 (Missing)
Facebook login code
UIView.animate(withDuration: 0.05, animations: {
self.loginWithFacebookView.alpha = 0
}, completion: { (true) in
UIView.animate(withDuration: 0.05, animations: {
self.loginWithFacebookView.alpha = 1
}, completion : { (true) in
self.showLoadingHUD("Signing in with facebook")
self.facebookLogin = FBSDKLoginManager()
self.facebookLogin.logIn(withReadPermissions: [EMAIL, PUBLIC_PROFILE], from: self, handler: { (facebookResult, facebookError) in
if facebookError != nil {
self.showAnAlert("Oops!", message: "\(String(describing: facebookError))")
self.hideLoadingHUD()
} else if (facebookResult?.isCancelled)! {
self.showAnAlert("Oops!", message: "\("Error while signing up")")
self.hideLoadingHUD()
} else if (facebookResult?.declinedPermissions.contains("email"))! {
print("email not granted")
FBSDKGraphRequest(graphPath: "me/permissions/", parameters: nil, httpMethod: "DELETE").start(completionHandler: {(_ connection: FBSDKGraphRequestConnection, _ result: Any, _ error: Error?) -> Void in
} as? FBSDKGraphRequestHandler)
self.hideLoadingHUD()
self.showAnAlert("Error", message: "Error while sign in - Email is required")
}
else {
let accessToken = FBSDKAccessToken.current().tokenString
let credential = FIRFacebookAuthProvider.credential(withAccessToken: accessToken!)
FIRAuth.auth()?.signIn(with: credential) { (user, error) in
if error != nil {
self.showAnAlert("Oops!", message: "\(String(describing: facebookError))")
} else {
_ = FBSDKGraphRequest(graphPath: "me", parameters: ["fields":"email,name"]).start { (connection, result, error) -> Void in
if error == nil {
// grabing the data and registring it with firebase
}