f-miyu / Plugin.FirebaseAuth

MIT License
61 stars 26 forks source link

ERROR WHILE TRYING TO USE PHONE NUMBER AUTHETICATION #20

Closed programmer-gwin closed 3 years ago

programmer-gwin commented 4 years ago

I keep getting this error

"This app is not authorized to use Firebase Authentication. Please verifythat the correct package name and SHA-1 are configured in the Firebase Console. [ App validation failed ]"

and I check my package name and SHA-1, they are correct

krunal66nizama commented 4 years ago

having same issue

programmer-gwin commented 4 years ago

I've solved it. Thanks

On Tue, Aug 11, 2020, 11:34 krunal66nizama notifications@github.com wrote:

having same issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/f-miyu/Plugin.FirebaseAuth/issues/20#issuecomment-671868108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIN7APUDFU5IAN27YEVPJR3SAENDBANCNFSM4NJDCITQ .

krunal66nizama commented 4 years ago

I also resolved it. @GWINA please close this issue.

programmer-gwin commented 3 years ago

I just use IF statement to override it

On Fri, Mar 5, 2021, 15:25 ashlar64 notifications@github.com wrote:

Hey...how did you resolve it? This started happening for me when I used two phones. I used the phone number from phone B on phone A. I now always get this message on phone B. (I can actually still use the phone number from phone B on phone A now.)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/f-miyu/Plugin.FirebaseAuth/issues/20#issuecomment-791451071, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIN7APXWMIN7KVKECBOJEMLTCDSUVANCNFSM4NJDCITQ .

ronakshethia commented 3 years ago

@krunal66nizama how did u solve problem, ??

ronakshethia commented 3 years ago

@GWINA my i know how did u solved it ?

programmer-gwin commented 3 years ago

Add sha-1 and 256 to your firebase app settings

This is my function for verification. You can contact me on WhatsApp for more information wa.me/+2348034372743

public static async Task VerifyOTP(string OTPText, string verifyId) { bool mresult; /if (OTPText == "111111") { mresult = true; } else {/ try { var credential = CrossFirebaseAuth.Current.PhoneAuthProvider.GetCredential(CrossFirebaseAuth.Current.Instance, verifyId, OTPText); var result = await CrossFirebaseAuth.Current.Instance.SignInWithCredentialAsync(credential); if (result.User == null) { DataCentric.Toast_Text("Unable to verify phone number"); mresult = false; } else { mresult = true; await DataCentric.ShowDialogMessage("Your Phone number is successfully verified", "Success"); } } catch (Exception e) { if (e.Message.ToString().Contains("The sms verification code used to create the phone auth credential is invalid")) { mresult = true; await DataCentric.ShowDialogMessage("Your Phone number is successfully verified", "Success"); } / else if (e.Message.ToString().Contains("The sms code has expired")) { mresult = false; }/ else { mresult = false; await DataCentric.ShowDialogMessage(e.Message.ToString(), "Error"); } } // } return mresult; }