I am peruvian, My english is terrible.
Sometimes, when i login with Firebase takes about 40 seconds.
Why does this happen?
Sometimes, when i login with Firebase takes about 40 seconds.
Why does this happen?
B4X:
Sub Process_Globals
Public userSocial As Map
Public auth As FirebaseAuth
Public facebook As FacebookSdk
Public stateFacebook As Boolean = False
End Sub
Sub Global
"variables"
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("view_login")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnLoginGoogle_Click
If Connected Then
ToastMessageShow("Los servicios de Google pueden tardar más de lo debido.", True)
auth.Initialize("auth")
auth.SignInWithGoogle
Else
ToastMessageShow("Sin acceso a internet.", False)
End If
End Sub
' Login con Facebook
Sub btnLoginFacebook_Click
If Connected Then
ToastMessageShow("Los servicios de Facebook pueden tardar más de lo debido.", True)
facebook.Initialize
facebook.SignIn
stateFacebook = True
Else
ToastMessageShow("Sin acceso a internet.", False)
End If
End Sub
' Metodo para obtener la información del usuario y el token de firebase
Sub Auth_SignedIn(userFirbase As FirebaseUser)
Log("SignedIn: " & userFirbase.DisplayName)
Log(userFirbase.Uid)
Log(userFirbase.Email)
Log(userFirbase.PhotoUrl)
userSocial.Initialize
userSocial.Put("Name",userFirbase.DisplayName)
userSocial.Put("Email", userFirbase.Email)
userSocial.Put("Url", userFirbase.PhotoUrl)
auth.GetUserTokenId(userFirbase, False)
ProgressDialogShow2("Verificando datos",False)
End Sub
' Obtener el token
Sub Auth_TokenAvailable (userFirbase As FirebaseUser, Success As Boolean, TokenId As String)
Starter.stateLogin = True
Log("token " & TokenId)
ProgressDialogHide
CallSubDelayed2(Starter, "CheckEmail", TokenId)
End Sub