Can't login to my firebase backend base app on iOS but works on android

I need help with my app on iOS.

I’ve completed building the app using firebase for the backend, while building I was testing it using only android device and emulator since I didn’t had a MacBook everything was good and working well, because of the fact that I need it on iOS too I bought MacBook pro 2012 recently and have installed all that is need to run the app and it’s runs on the emulator without errors but can’t l login on the emulator, if I try with a wrong password it returns an error meaning that it interacted with the db.

The app is working well on android

I really need help on this, thanks.

can you please provide us logs, front end code etc?
what is the http response?

thanks for your response.

i just found out this and it help me solve the issue.

really appreciate your response.

Here is the solution to the issue,
I added this code in app.component and it is working in the iOS simulator. Here is the full file with imports:

import { Component } from '@angular/core';
import { Capacitor } from '@capacitor/core';
import { initializeApp } from 'firebase/app';
import { indexedDBLocalPersistence, initializeAuth } from 'firebase/auth';
import { environment } from 'src/environments/environment';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html',
  styleUrls: ['app.component.scss'],
})
export class AppComponent {
  constructor() {
    const app = initializeApp(environment.firebase);
    if (Capacitor.isNativePlatform) {
      initializeAuth(app, {
        persistence: indexedDBLocalPersistence
      });
    }
  }
}

source: Firebase auth in SDK 9 does not work on ios sim or devices - #8 by uncoded

1 Like

I’m having same issue with my app. Can you please share your app.module.ts codes?