Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase authentication: listen for failures

I've been trying to listen fail events for user authentication. For testing purpose I closed my internet connection and try to sign up. Neither onFailureListener or !task.isSuccessful invokes. So how do you guys listen for failed events?


1 Answers

Firebase doesn't response listener when no internet, for check internet connection you can do it programmatically

if(isNetworkAvailable()){
    //
    // Authentication with Firebase
    // 
}else{
    //Display message/aleart "No internet connection" to user
}

To check isNetworkAvailable(), please see HERE

like image 88
Linh Avatar answered Feb 14 '26 17:02

Linh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!