whit3
January 8, 2022, 2:29pm
1
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?
whit3
January 10, 2022, 1:52pm
3
thanks for your response.
i just found out this and it help me solve the issue.
I recently moved to the firebase v9 sdk for a brand new ionic/angular project. I was able to get the signInWithEmailAndPassword call to work in a web browser but it hangs in iphone simulators and devices. Strangely, it works in the ipad simulator. If I take the same app and switch it to the v8 firebase sdk, the login process works on all sims and devices.
I contacted Firebase tech support. I got the “It’s not us it’s ionic” response. Was not the kind of response I expected.
Any who, be aware t…
really appreciate your response.
whit3
January 10, 2022, 2:06pm
4
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?