Firebase auth in SDK 9 does not work on ios sim or devices

My app module is not relevant, but I will post it:

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {RouteReuseStrategy} from '@angular/router';

import {IonicModule, IonicRouteStrategy} from '@ionic/angular';

import {AppComponent} from './app.component';
import {AppRoutingModule} from './app-routing.module';

import {HttpClient, HttpClientModule} from '@angular/common/http';
import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';

import {firebaseConfig} from './***';
import {provideFirebaseApp, initializeApp} from '@angular/fire/app';
import {enableIndexedDbPersistence, getFirestore, provideFirestore} from '@angular/fire/firestore';
import {getAuth, initializeAuth, provideAuth, indexedDBLocalPersistence} from '@angular/fire/auth';
import {AuthenticationGuardService} from './authentication-guard.service';
import {AuthenticationService} from './authentication.service';
import {Capacitor} from '@capacitor/core';

  declarations: [AppComponent],
  entryComponents: [],
  imports: [
      loader: {
        provide: TranslateLoader,
        useFactory: httpLoaderFactory,
        deps: [HttpClient]
    provideFirebaseApp(() => {
      const app = initializeApp(firebaseConfig);
      if (Capacitor.isNativePlatform) {
        initializeAuth(app, {
          persistence: indexedDBLocalPersistence
      return app;
    provideFirestore(() => {
      const firestore = getFirestore();
      return firestore;
    provideAuth(() => getAuth()),
  providers: [AuthenticationGuardService,AuthenticationService, {provide: RouteReuseStrategy, useClass: IonicRouteStrategy}],
  bootstrap: [AppComponent],
export class AppModule {

// required for AOT compilation
export function httpLoaderFactory(http: HttpClient) {
  return new TranslateHttpLoader(http);

in the app.component.ts I don’t have anything related to the initialisation.