I've been struggling with this issue for a while now and have reached a point where I am unable to find a solution on my own. Therefore, I have decided to reach out and ask for help by posting my own question.
In my Ionic 7 Vue application, I am using Firebase Auth for user management. The code functions perfectly in browsers and on Android devices, allowing users to sign in successfully. However, when it comes to iOS devices or simulators, the functionality seems to break down.
Upon a user signing in, the following function is triggered (please note that the auth object is omitted here for brevity):
import {signInWithEmailAndPassword, UserCredential } from "firebase/auth";
const signInUser = async (email: string, password: string) => {
try{
const res = await signInWithEmailAndPassword(auth, email, password)
console.log("Successfully logged in with Firebase, UID: "+res.user.uid)
}
catch(error){
const errorCode = error.code;
const errorMessage = error.message;
console.error("Error Code: " + errorCode + " - Error Message: " + errorMessage);
}
}
The error message triggers as expected, displaying the relevant error if there is one, such as an incorrect password input. However, when the correct credentials are entered, the console log within the try block fails to execute. It appears to hang indefinitely, almost as if the promise from the await call never resolves. Additionally, no errors are visible in my Xcode output.
An interesting observation is that the Firebase console confirms that the login event indeed takes place. This suggests that the functionality is actually working, but I may not be handling the resolved promise correctly.
I'm hoping that I might have overlooked something simple or made a minor mistake that someone knowledgeable here can identify. Alternatively, any insights or workarounds for this particular issue would be greatly appreciated.