firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
833 stars 428 forks source link

[Question] #1084

Closed adityathoutam closed 3 years ago

adityathoutam commented 3 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the question here:

Is there anyway to get proper error code from the verificationFailed callback while using VerifyPhoneNumber in PhoneAuth?

verificationFailed: (error) => { // The verification code was not sent. // error contains a human readable explanation of the problem. },

Right now it is giving a human readable explanation like this

"The format of the phone number provided is incorrect. Please enter the phone number in a " + "format that can be parsed into E164 format. E164 phone numbers are written in the format " + "[+][country code][subscriber number including area code] [ TOO_SHORT]"

I'm assuming TOO_SHORT is the error code, where can I find the other types of error codes, and is there anyway to just get TOO_SHORT instead of this whole "human readable explanation"?

paulinon commented 3 years ago

Hi @adityathoutam,

I found this list of error codes for Firebase Authentication in Unity. TOO_SHORT isn't part of the list, so it's possible that the explanation corresponds to another error code.

Should you have any other questions about this, you may reach out to Firebase Support.

adityathoutam commented 3 years ago

@paulinon should I make this a feature request? It seems like an oversight, I couldn't find AuthError anywhere.

paulinon commented 3 years ago

Hi @adityathoutam,

You may file a feature request for retrieving the error code when verification fails.