Facebook login Access token is nil

I integrated the connection with facebook and firebase. when I try the button in the simulator, everything is fine. but when I test it on the iPhone, I get this error message
Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value

func loginButton(_ loginButton: FBLoginButton, didCompleteWith result: LoginManagerLoginResult?, error: Error?) {
if let error = error {
print(error.localizedDescription)
return
}
let current = AccessToken.current!.tokenString
let credential = FacebookAuthProvider.credential(withAccessToken: current)