Skip to content

signInWithCredential does not resolve in iOS #5497

@harry-herskowitz

Description

@harry-herskowitz

I am using firesbase-js-sdk with capacitor. In iOS, Calling signInWithCredential successfully creates or logs in a user in Firebase, but the promise does not resolve. In the following code, neither .then or .catch blocks run. The promise hangs indefinitely.

export const googleLogin = async () => {
  // 1. Create credentials on the native layer
  const result = await FirebaseAuthentication.signInWithGoogle()
  // 2. Sign in on the web layer using the id token
  const credential = GoogleAuthProvider.credential(result.credential?.idToken)
  const auth = getAuth()
  await signInWithCredential(auth, credential)
    .then((response) => console.log(response))
    .catch((err) => console.log(err))
}

The promise is resolved as expected in the web app. I tested this on iOS 14.5 (iPhone 8, simulator) and iOS 14.7.1 (iPhone 8, physical).

Here is another discussion about it: robingenz/capacitor-firebase-authentication#78

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions