Calling verifyPhoneNumber on my firebase ios app throws "internal-error"

Viewed 199

I use authentication by phone number in my flutter app. While it is working fine on Android I'm getting an error message on ios:

_firebaseAuth.verifyPhoneNumber(
        phoneNumber: phoneNumber,
        timeout: ...
        verificationCompleted: ...
        verificationFailed: verificationFailed,
        codeSent: codeSent
...

static final PhoneVerificationFailed verificationFailed =
      (FirebaseAuthException authException) {
    Log.e(authException.message);
    Log.e(authException.code);
}

Code and message both only says it is an internal error without any details.

Everything worked find before I moved the app to a new Appel developer account. This means the team id has changed.

I've also changed the team id here: enter image description here

I've downloaded the google.plist again and put it into the runner directory.

The google cloud platform also shows the correct team id:

enter image description here

The same team id is shown in xcode in "Signing & Capabilities" -> Signing Certificate.

Changing the team id also causes loosing access to the keychain:

ITMS-90076: Potential Loss of Keychain Access - The previous version of software has an application-identifier value of ['MKYCXH32H9.com.sykori.framr2'] and the new version of software being submitted has an application-identifier of ['75GNKYT7HC.com.sykori.framr2']. This will result in a loss of keychain access.

But I think the only means that data from previous versions is not accessible anyomore.

1 Answers

Since you said the issue appeared after you switched developer accounts, it's safe to assume the issue is generated by a config error.

Firebase Phone Auth for iOS docs specify a couple more steps than what you described above, namely:

  1. Upload your APNs authentication key to Firebase. If you changed developer accounts APN auth keys also changed.
  2. To enable Firebase SDK to use reCAPTCHA you need to add the REVERSED_CLIENT_ID to your URL Schemes box on the configuration page. enter image description here

These two steps I think will solve the issue, but just to be sure you could go through all the steps from the docs to make sure nothing else is missing.

Related