I am using Firebase SMS verification for Authentication. The code works fine on most of the devices but it shows 'com.google.firebase.auth.FirebaseAuthException'
on OPPO A37fw.
This is my code and it works fine on every devices including other Oppo devices .Only On OPPO A37fw this error is shown.
PhoneAuthProvider.OnVerificationStateChangedCallbacks callbacks
= new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@Override
public void onVerificationCompleted(PhoneAuthCredential credential) {
Log.d(TAG, "onVerificationCompleted:" + credential);
MobileVerification.credential = credential;
openOTPvalidation(ON_VERIFICATION);
}
@Override
public void onVerificationFailed(FirebaseException e) {
postException(context, TAG, e);
}
@Override
public void onCodeSent(String s, PhoneAuthProvider.ForceResendingToken token) {
super.onCodeSent(s, token);
verificationCode = s;
forceResendingToken = token;
openOTPvalidation(OTP_SEND);
}
};
private void getOTP() {
if (activity != null) {
pDialog = SupportingMethods.showDialogLoading(activity);
pDialog.show();
}
String mobile = "+91" + mob;
PhoneAuthProvider.getInstance().verifyPhoneNumber(
mobile, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
activity, // Activity (for callback binding)
callbacks); // OnVerificationStateChangedCallbacks
}
And the Logcat shows :
com.google.firebase.auth.FirebaseAuthException: 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 ]
at com.google.firebase.auth.api.internal.zzdr.zzb(Unknown Source)
at com.google.firebase.auth.api.internal.zzet.zza(Unknown Source)
at com.google.firebase.auth.api.internal.zzew.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:160)
at android.app.ActivityThread.main(ActivityThread.java:5541)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
************ DEVICE INFORMATION ***********
Brand: OPPO
Device: A37f
Model: A37fw
Id: LMY47V
Product: A37fw