Android Question Firebase sign In email/password FirebaseAuthEx2 V0.03

gregorio_adrian_gimenez

Active Member
Licensed User
Longtime User
Hi!
I was testing FirebaseAuthex2, I find two problems.

First

the resetpassword function not found.
B4X:
Sub btnResetPassword_Click
    authex.sendPasswordResetEmail("xxxxxxxx")
End Sub

I Verify in Firebase and in the email account, do not execute the command It does not return any errors and does not call the function:
B4X:
Sub AuthEx_PasswordReset(success As Boolean)
    Log($"AuthEx_PasswordReset(${success})"$)
End Sub


second

Trying to create an account generates the following error.

I Verify that the mail and password have values
Error occurred on line: 73 (crea_cuenta_mail)
java.lang.NullPointerException: Activity must not be null
at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:p[email protected]@17.1.0:11)
at com.google.android.gms.common.api.internal.LifecycleActivity.<init>(com.google.android.gms:p[email protected]@17.1.0:2)
at com.google.android.gms.common.api.internal.LifecycleCallback.getFragment(com.google.android.gms:p[email protected]@17.1.0:7)
at com.google.android.gms.tasks.zzu$zza.zza(Unknown Source)
at com.google.android.gms.tasks.zzu.addOnCompleteListener(Unknown Source)
at de.donmanfred.FirebaseauthExwrapper.signInWithEmailAndPassword(FirebaseauthExwrapper.java:58)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4793)
at android.view.View$PerformClick.run(View.java:19950)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5593)
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:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Thanks for helping
 

DonManfred

Expert
Licensed User
Longtime User
I Verify in Firebase
if you verify in firebase console then NO event is fired in your app/my library.

Only when using the method in my lib.

B4X:
Sub Globals
    Private lblName As Label
    Private btnSigninemailpassword As Button
    Private auth As FirebaseAuth
    Private authex As FirebaseauthEx
    Private btnfetch As Button
    Private btnResetPassword As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        auth.Initialize("auth")
        authex.Initialize("authex")
    End If
    Activity.LoadLayout("1")
   
    If auth.CurrentUser.IsInitialized Then Auth_SignedIn(auth.CurrentUser)
End Sub
Sub Auth_SignedIn (User As FirebaseUser)
    Log("SignedIn: " & User.DisplayName)
    lblName.Text = "Hello "&User.DisplayName
End Sub
Sub btnSignIn_Click
    auth.SignInWithGoogle
End Sub
Sub btnSignOut_Click
    lblName.Text = "Goodbye!"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub


Sub AuthEx_onAuthenticated(success As Boolean, result As Object, info As String)
    Log($"AuthEx_onAuthenticated(${success}, ${result}, ${info})"$)
    If success Then
        If auth.CurrentUser.IsInitialized Then Auth_SignedIn(auth.CurrentUser)
    End If
End Sub

Sub btnSigninemailpassword_Click ' works
    authex.signInWithEmailAndPassword("xxxx","xxxx")
End Sub
Sub btnfetch_Click ' works
    authex.fetchSignInMethodsForEmail("xxxx")
End Sub
Sub AuthEx_SignInMethods(success As Boolean, methods As List) ' works
    Log($"AuthEx_SignInMethods(${success},${methods})"$)
    If methods <> Null And methods.IsInitialized And methods.Size > 0 Then
        For i=0 To methods.Size-1
            Dim method As String = methods.Get(i)
            Log("LoginMethod: "&method)
        Next
    End If
End Sub
Sub AuthEx_PasswordReset(success As Boolean) ' Works
    Log($"AuthEx_PasswordReset(${success})"$)
End Sub
Sub btnResetPassword_Click ' works
    authex.sendPasswordResetEmail("xxxx")
End Sub
 

Attachments

  • FirebaseAuthEx2V0.04.zip
    6.4 KB · Views: 200
Upvote 0

Enrico Fuoti

Member
Licensed User
Longtime User
Hallo Manfred,
I can see you've done a great work with firebase auth with email/password option.
I searched the forum looking for main thread with methods and infos of your FirebaseAuthex2 library, but I was not able to find it.
Should it be considered as a new version of FirebaseAuthEx one?
I'm a bit confused also with FirebaseAuthUI.. which one you would recommend?
 
Upvote 0

gregorio_adrian_gimenez

Active Member
Licensed User
Longtime User
HI, I am using FirebaseAuth and FirebaseAuthex2 V0.04 simultaneously and it works perfect.
google, facebook with FirebaseAuth
email account, reset password, and account creation whith firebaseAuthex2 V 0.04

FirebaseAuthEx not work very well.
regards
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Enrico Fuoti

Member
Licensed User
Longtime User
thank you for your answers,
i'll try it out myself as I have the same need.
BTW, do you think there is a chance to get it work for b4i ?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
do you think there is a chance to get it work for b4i ?
No. B4A Libraries are based on JAVA. B4i on another language. I do not use B4i or even don´t know the language used. No chance that i do a B4i version.

For ANY further questions (and for the future at all). PLEASE DO create a NEW thread for your issues/questions instead of posting to a Thread from another user. This thread is considered as answered already.
 
Upvote 0
Top