First I am calling -
FBSDKLoginManager().logIn(withReadPermissions: ["public_profile", "email"], from: self)
On success getting credential -
let credential = FacebookAuthProvider.credential(withAccessToken: FBSDKAccessToken.current().tokenString)
Then passing the credential to linkAndRetrieveData -
Auth.auth().currentUser?.linkAndRetrieveData(with: credential)
Getting this error, which says “MISSING_ID_TOKEN” -
{
FIRAuthErrorUserInfoNameKey = "ERROR_INTERNAL_ERROR";
NSLocalizedDescription = "An internal error has occurred, print and inspect the error details for more information.";
NSUnderlyingError = "Error Domain=FIRAuthInternalErrorDomain Code=3 \"(null)\" UserInfo={FIRAuthErrorUserInfoDeserializedResponseKey={\n code = 400;\n message = \"MISSING_ID_TOKEN\";\n status = \"INVALID_ARGUMENT\";\n}}";
"error_name" = "ERROR_INTERNAL_ERROR";
}
It works fine with -
Auth.auth().signInAndRetrieveData
What I am doing wrong here?