firebase / firebaseui-web

FirebaseUI is an open-source JavaScript library for Web that provides simple, customizable UI bindings on top of Firebase SDKs to eliminate boilerplate code and promote best practices.
https://firebase.google.com/
Apache License 2.0
4.57k stars 1.05k forks source link

Social login fails in Capacitor (both iOS & Android) #973

Open jahertor opened 2 years ago

jahertor commented 2 years ago

[REQUIRED] Describe your environment

[REQUIRED] Describe the problem

I'm trying to integrate Firebase UI in my app created with Capacitor. The email/password login works ok, but when I add the social logins the problems begins.

In every case I'm using ionic:// as scheme, as the documentation says so.

But the documentation says that I have to use ionic:// or file:// as protocol.

I think this error is because I'm not using https protocol, but I can't regarding the documentation.

Everything is working in web.

Steps to reproduce:

Relevant Code:


const config: CapacitorConfig = {
  //...
  server: {
    androidScheme: 'ionic',
    iosScheme: 'ionic'
  }
};```

```javascript
this.ui.start('#firebaseui-auth-container', {
  signInFlow: 'redirect',
  signInOptions: [
    firebaseauth.GoogleAuthProvider.PROVIDER_ID,
    "apple.com",
    firebaseauth.EmailAuthProvider.PROVIDER_ID
  ],
  // Other config options...
  callbacks: {
    signInSuccessWithAuthResult: (authResult, _) => {
      // User successfully signed in.
      // Return type determines whether we continue the redirect automatically
      // or whether we leave that to developer to handle.
      this.repo.storeUserId(authResult.user.uid);
      this.repo.storeUserEmail(authResult.user.email);
      this.redirectHome();
      return false;
    },
    uiShown: () => {
      // The widget is rendered.
      // Hide the loader.
      this.loading = false;
    }
  },
});```
CristinaEdgin commented 2 years ago

Delete it

jhuleatt commented 1 year ago

We're not familiar with Capacitor, but if you have an idea of how to fix this we'd welcome a PR.

ebadi commented 1 year ago

@jahertor Same problem here, did you happen to find a solution?