I guided myself in this tutorial https://www.b4x.com/android/forum/threads/firebaseauth-authenticate-your-users.67875/ works perfectly but when the device does not have access to the internet I have a problem can help me please, how to solve
this is the login code
attached error when the device does not have access to the internet I have a problem
I also want to know how to control this error when the user is disabled in firebase, do not leave this error
this is the login code
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
' Private ClientId As String = "706692133530-ea9e1v214b2hdrm0td9r5bt173nk7nsm.apps.googleusercontent.com"
' Private oauth2 As GoogleOAuth2
Public auth As FirebaseAuth
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
' ++++++++++++++++++++++ id credencial se obtiene de registrar en el api gmail
Private lblName As Label
Private btnIrRegister As Button
Private btnIniciarSesion As Button
Private btnInicioGoogle As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
https://www.googleapis.com/auth/user.birthday.read")
If FirstTime Then
auth.Initialize("auth")
End If
Activity.LoadLayout("frmInicio")
If auth.CurrentUser.IsInitialized Then
Auth_SignedIn(auth.CurrentUser)
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnIrRegister_Click
StartActivity(Registro)
End Sub
Sub btnIniciarSesion_Click
StartActivity(MenuEleccion)
End Sub
Sub btnInicioGoogle_Click
auth.SignInWithGoogle
End Sub
'+++++++++ Gmail +++++++++++++++++++++++++++++++++++++++++++
Sub Auth_SignedIn (User As FirebaseUser)
Log("SignedIn: " & User.DisplayName)
' lblName.Text = "Hello: " & User.DisplayName
Starter.kvs.Put("Usuario",User.DisplayName)
Starter.kvs.Put("Email",User.Email)
Starter.kvs.Put("PhotoUrl",User.PhotoUrl)
Starter.kvs.Put("Uid",User.Uid)
ToastMessageShow("Hola "&User.DisplayName,False)
StartActivity(MenuEleccion)
Activity.Finish
End Sub
attached error when the device does not have access to the internet I have a problem
B4X:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzj@3e280e4
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
com.google.android.gms.tasks.RuntimeExecutionException: com.google.firebase.FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
at com.google.android.gms.tasks.zzu.getResult(Unknown Source)
at anywheresoftware.b4a.objects.FirebaseAuthWrapper$5.onComplete(FirebaseAuthWrapper.java:170)
at com.google.android.gms.tasks.zzj.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: com.google.firebase.FirebaseNetworkException: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
at com.google.firebase.auth.api.internal.zzds.zzb(Unknown Source)
at com.google.firebase.auth.api.internal.zzew.zza(Unknown Source)
at com.google.firebase.auth.api.internal.zzeo.zzc(Unknown Source)
at com.google.firebase.auth.api.internal.zzep.onFailure(Unknown Source)
at com.google.firebase.auth.api.internal.zzdy.dispatchTransaction(Unknown Source)
at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:565)
I also want to know how to control this error when the user is disabled in firebase, do not leave this error
B4X:
Registo conectado a: 9DLDU17302001839
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
SignedIn: Ricardo Males
** Activity (main) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzj@32bf64e
** Activity (main) Pause, UserClosed = true **
sending message to waiting queue (auth_signedin)
** Activity (menueleccion) Create, isFirst = true **
** Activity (menueleccion) Resume **
** Activity (menueleccion) Pause, UserClosed = true **
** Activity (menucomida) Create, isFirst = true **
** Activity (menucomida) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzj@32bf64e
** Activity (menucomida) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
running waiting messages (1)
SignedIn: Ricardo Males
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (menueleccion) Create, isFirst = false **
** Activity (menueleccion) Resume **
** Activity (menueleccion) Pause, UserClosed = true **
** Activity (menucomida) Create, isFirst = false **
** Activity (menucomida) Resume **
onAuthStateChanged: com.google.firebase.auth.internal.zzj@32bf64e
** Activity (menucomida) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
SignInWithGoogle called
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
SignInWithGoogle.ResultArrived
ResultArrived Success
** Activity (main) Resume **
com.google.android.gms.tasks.RuntimeExecutionException: com.google.firebase.auth.FirebaseAuthInvalidUserException: The user account has been disabled by an administrator.
at com.google.android.gms.tasks.zzu.getResult(Unknown Source)
at anywheresoftware.b4a.objects.FirebaseAuthWrapper$5.onComplete(FirebaseAuthWrapper.java:170)
at com.google.android.gms.tasks.zzj.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:941)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
Caused by: com.google.firebase.auth.FirebaseAuthInvalidUserException: The user account has been disabled by an administrator.
at com.google.firebase.auth.api.internal.zzds.zzb(Unknown Source)
at com.google.firebase.auth.api.internal.zzew.zza(Unknown Source)
at com.google.firebase.auth.api.internal.zzeo.zzc(Unknown Source)
at com.google.firebase.auth.api.internal.zzep.onFailure(Unknown Source)
at com.google.firebase.auth.api.internal.zzdy.dispatchTransaction(Unknown Source)
at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:565)
Last edited: