B4A Library FirebaseAuth - Authenticate your users

Status
Not open for further replies.

DonManfred

Expert
Licensed User
Longtime User
FireaseAuthEx

New in V1.12
- signInAnonymously
- createUserWithEmailAndPassword
- SignInWithEmailAndPassword
- sendPasswordResetEmail

New Methods for the firebaseuser object
- updateEmail
- updatePassword
- delete
 
Last edited:

johndb

Active Member
Licensed User
Longtime User
Thank you @DonManfred. I added the eMail & Password Authentication to my app (for testing purposes). This works well if a user/password is manually added to USERS using the Firebase console. It also works when createUserWithEmailAndPassword is used to create the user within the App. However, the email/user management methods are not currently implemented in the update FirebaseAuth V1.1. These include sendEmailVerification, updatePassword, delete, to mention a few of the methods. I'm not really sure how these can be implemented but may be worth considering? I do appreciate you adding email/password and Anonymous Authentication methods as it does add more functionality to Firebase Authentication. Thank you

John
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:

DonManfred

Expert
Licensed User
Longtime User

DonManfred

Expert
Licensed User
Longtime User
please create a new library named FirebaseAuthEx with your changes
I´ve updated my post above and posted the new library.

I´m not sure if this is the right solution but it works.
It is basically a copy of the original but without GoogleSignIn and with my changes. And a different FirebaseUser-Object (FirebaseAuthUser) as it provides more properties and also new methods... Maybe the name is a bit irritating now as i read it here...
 

johndb

Active Member
Licensed User
Longtime User
Seems a bit awkward to me having two libraries for FirebaseAuth! There is a problem with the "... CurrentUser.EmailVerified" method. See below.

java.lang.NoSuchMethodError: No virtual method isEmailVerified()Z in class Lcom/google/firebase/auth/FirebaseUser; or its super classes (declaration of 'com.google.firebase.auth.FirebaseUser' appears in /data/app/com.scsoftstudios.timeslicer-1/base.apk)
at de.donmanfred.FirebaseAuthExWrapper$FirebaseAuthUserWrapper.getEmailVerified(FirebaseAuthExWrapper.java:194)
at com.scsoftstudios.timeslicer.main._signedin(main.java:1730)
at com.scsoftstudios.timeslicer.main._activity_resume(main.java:1622)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
at com.scsoftstudios.timeslicer.main.afterFirstLayout(main.java:108)
at com.scsoftstudios.timeslicer.main.access$000(main.java:17)
at com.scsoftstudios.timeslicer.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:77)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:333)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
... 8 more
 

DonManfred

Expert
Licensed User
Longtime User
Seems a bit awkward to me having two libraries for FirebaseAuth!
You need to decide for one i guess

If you only want to use my lib (and NOT FirebaseAuth too) then you need to add the two dependencies from the firebaseAuth xml to the xml from my lib.

Or you add
B4X:
#additionaljar: com.google.firebase:firebase-auth
#additionaljar: com.google.android.gms:play-services-auth
to your project

You also can check both libs and just use my if you want... The dependencies will be filled with marking FirebaseAuth in the libs tab...
 

johndb

Active Member
Licensed User
Longtime User
I will be using both giving the user the option to use various methods for authentication. All worked well when FirebaseAuth was one library. Nonetheless, what is the problem with the CurrentUser.EmailVerified method?

Thanks for your hard work!

John
 

desof

Well-Known Member
Licensed User
Longtime User
Nothing works for me ever comes the code flow there!
I put a user and nothing happens.
What can it be?
I have Google Sign-In enabled in Firebase


B4X:
 Sub Auth_SignedIn (Usuario Como FirebaseUser)
    Log ( "SignedIn:" & User.DisplayName)
    lblName.Text = "Hola" y User.DisplayName
End Sub
[/CÓDIGO]
 

DonManfred

Expert
Licensed User
Longtime User
Nothing works for me ever comes the code flow there!
the sub signature is definetively wrong

B4X:
Sub Auth_SignedIn (Usuario Como FirebaseUser)
    Log ( "SignedIn:" & User.DisplayName)
    lblName.Text = "Hola" y User.DisplayName
End Sub
I´m sure you´ll get an error in the ide when compiling.

It must be

B4X:
Sub Auth_SignedIn (user As FirebaseUser)
    Log ( "SignedIn:" & User.DisplayName)
    lblName.Text = "Hola" y User.DisplayName
End Sub
 

desof

Well-Known Member
Licensed User
Longtime User

Can you give me more details please
My signature in the IDE? Can I put it in the DEMO version I'm using?
 

desof

Well-Known Member
Licensed User
Longtime User

Please I need help .
I just bought my license of the new version and I ask for help.
I stay in this step!
I have the code SHA1 but I do not know where to put it
It's not very clear to me
 

desof

Well-Known Member
Licensed User
Longtime User
[Quote = "Filippo, mensaje: 449055, miembro de: 103"], pero no puedo encontrar "SHA1", sólo tengo este punto de vista.

[ATTACH = completo] 47565 [/ attach] [/ quote]

Tengo this Mismo Problema ..

Como lo solucionaste ?
 

jtare

Active Member
Licensed User
Longtime User
Nothing works for me ever comes the code flow there!
I put a user and nothing happens.
What can it be?
I have Google Sign-In enabled in Firebase
ES- Al parecer estas traduciendo el código, el código solo funciona en ingles no puede ser traducido (todos los lenguajes de programacion que conozco solo corren en ingles).
EN- It seems that you are translating the code, the code only run in english(all programming languages I know only run in english)
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…