Luiz Fernando
Luiz Fernando

Reputation: 11

Firebase Authenticate on IOS using a Phone Number - [auth/internal-error]

I made a code in ionic to authenticate using a phone number in firebase, on the web and on android it works perfectly, the behavior on ios is different when I try to call a method to send the OTP.

   let recpVerify = new RecaptchaVerifier(name, {
      'size': 'invisible',
      'callback': (response: any) => {
      }
    }, authentication);

    signInWithPhoneNumber(authentication, '+' + window.localStorage.getItem("phone"), recpVerify)
      .then((confirmationResult) => {

auth/internal-error

auth/internal-error debugger

The only message I was able to get is "auth/internal-error". Apparently I did all the settings as described but without success, looking at all the posts seems to have a problem when using the RecaptchaVerifier component where it cannot be rendered on ios, I tried some solutions such as capacitor-firebase-auth, without success.

The question is, is there any solution to this? It is not possible for it to work for other platforms and only for ios have this problem.

Upvotes: 1

Views: 531

Answers (1)

Galen Howlett
Galen Howlett

Reputation: 675

I haven't figured out the specific issue but it seems to me to have to do with the host url. If you add the --external configuration you should be able to execute requests (although may run into ssl / authorized domain issues).

ionic capacitor run ios --external

Upvotes: 0

Related Questions