Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48983

React Ionic and Google Firebase auth errors when using ios mobile application

$
0
0

Hi All,
I am currently having some issues trying to integrate Google Firebase authentication into a React Ionic mobile application. So far I have been able to set up the app to run correctly on both web and android but am running into repeated issues with IOS. The code runs correctly for Firebase auth login on android does not seem to be running on IOS.

The initial call to “signInWithEmailAndPassword” seems to work fine and returns “auth/multi-factor-auth-required” but any time I try to make a call to “verifyPhoneNumber” on ios I will receive the response of “Firebase: An internal AuthError has occurred. (auth/internal-error)”, there are no further details provided.

//Firebase setup in seperate file with code like these 2 lines 
app.initializeApp(config);
const firebaseAuth = app.auth();
//

firebaseAuth
.signInWithEmailAndPassword(email, password)
.then(function (user) {
        //other code
})
.catch(function (error) {
        if (error.code === "auth/multi-factor-auth-required") {
            let resolver = error.resolver;
            setTimeout(() => {
                dispatch(phoneAuth(appVerifier, resolver));
            }, 2000);
      } else {
          //other code
      }
});

var phoneInfoOptions = {
    var phoneInfoOptions = {
      multiFactorHint: resolver.hints[0],
      session: resolver.session,
    };
    var phoneAuthProvider = new firebase.PhoneAuthProvider();
    phoneAuthProvider
      .verifyPhoneNumber(phoneInfoOptions, appVerifier)
      .then(function (verificationId) {
        console.log("verify Id recieved");
      })
      .catch((error) => {
        console.log(error);
      });

Things I have checked/tried so far are:
followed all steps in firebase docs
Setup ios app in firebase console and followed the steps listed

Has anyone run into issues like this previously and has any advice on what I could check next?

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles