Why my Firebase Phone Auth isn't working?

  • Thread starter Thread starter Android Central Question
  • Start date Start date
A

Android Central Question

Hi guys,
I was trying for several days to implement the Phone Auth by Firebase but with no success.
I fallowed the steps from their official site.

So, my code looks like this: ( that's from activity)

_______________________________________________________________

private FirebaseAuth mAuth;
Button send_conf_code_button;
private PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks;

@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);

mAuth = FirebaseAuth.getInstance();

mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
@override
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
Log.d("tag-phone","onVerificationCompleted");

}

@override
public void onVerificationFailed(FirebaseException e) {
Log.d("tag-phone","onVerificationFailed");
}
};

send_conf_code_button.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {

// get the phone number entered by user inside an TextInputEditText
String phoneNumber = phone_number.getText().toString().trim();

PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
Register3Activity.this, // Activity (for callback binding)
mCallbacks); // OnVerificationStateChangedCallbacks
}
});
__________________________________________________________

My Gradle dependencies looks like this:
___________________________________________________________
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-auth:16.2.1'
implementation 'com.google.firebase:firebase-core:16.0.8'
}
_____________________________________________________________
(I dont have any warnings in it)

- My project is connected to Firebase.
- My Phone Auth method is Enabled.

I use in my project Email Auth from Firebase too, but this one works perfectly.

When I enter my phone: ( +40 73198***8 ) and i click the " Send confirmation button " the 'Run' tab prints those two:

W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzam@6f3f28

I/PhoneAuthProvider: Sms auto retrieval timed-out.

_______________________________________________
Other infos:
- I live in Romania, i checked and my country is available for this service.
- In my project(Tools->Firebase->Authentification), even though I have enabled the phone auth in Firebase Console App, the auth options shows just the email one ( that works right )
_______________________________________________

What can I do guys?
I am so tired of trying and searching solutions..

Thank you so much,
Madalin.
 
I moved this to the Software Development forum for more specific traffic.
 

Trending Posts

Forum statistics

Threads
956,555
Messages
6,968,815
Members
3,163,566
Latest member
satyamparihar