Firebase auth web SDK not working on Ionic iOS?

Viewed 71

My issue is the login with the email and password function works fine on android but on iOS, the promise is never returned ( nor failed ) when correct credentials are provided but it fails if I provide incorrect credentials. The login works on iOS with live reload simulating on an iOS device, but when installed with test-flight or via xCode promise is never returned nor rejected.

How can I debug it further or know what the underlying issue is?

onSubmit: async (values) => {
              try {
                const auth = getAuth(firebaseApp);
                auth.setPersistence(browserSessionPersistence);
               
                // Never called on IOS
                auth.onAuthStateChanged(() => {
                  console.log('I am here', auth.currentUser);
                  if (auth.currentUser) {
                    updateIsAuthenticated(true);
                  }
                });

                const userCred = await signInWithEmailAndPassword(auth, values.email, values.password);
                //Never runs
                console.log('After Success', userCred);

              } catch (error) {
                // Runs when provided with false credentials
                setError('Error: Authentication failed');
                console.error('An error Occurred');
              } finally {
                console.log('Running Finally');
              }
            },

        });
0 Answers
Related