1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

Android Question Problem with FirebaseAuth example

Discussion in 'Android Questions' started by toby, Jan 1, 2018.

  1. toby

    toby Member Licensed User

    Happy New Year!

    I followed the instructions precisely to the best of my knowledge. However the following event was never raised:
    Code:
    Sub Auth_SignedIn (User As FirebaseUser)
        
    Log("SignedIn: " & User.DisplayName)
        lblName.Text = 
    "Hello: " & User.DisplayName
    End Sub
    Each time the Sign in with Google button was pressed, the following log entries would be added:
    I got the same result with both b4a7.30 and 7.80. Test phone: Asus zenfone 2, android 5.0. Could someone tell me what went wrong, please?

    The complete debug log:
     
    Last edited: Jan 1, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the unfiltered logs (uncheck the Filter option)?
     
    Peter Simpson and toby like this.
  3. toby

    toby Member Licensed User

    After unchecking the Filter checkbox (it's checked by default), there were much more log information as shown below. The original package name b4a.firebase was used during previous attempt, so I appended 2 to it to have a new package name.

     
  4. Erel

    Erel Administrator Staff Member Licensed User

    It must match the package name you created in Firebase console.
     
    toby likes this.
  5. toby

    toby Member Licensed User

    yes, it does.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Replace your current jar with the one attached and clean the project (Ctrl + P).

    It should print more information in the logs.
     

    Attached Files:

    toby likes this.
  7. toby

    toby Member Licensed User

    Erel,

    Thank you very much for the speedy responses!:)

    Below is the new log with your new firebaseAuth.jar file.

     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Can you upload your project?
     
    toby likes this.
  9. toby

    toby Member Licensed User

    it also includes firebase console screenshot and latest unfiltered logs in logs.txt file.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    I've removed the file.

    Please try it with the attached jar. It adds more debugging information.
     

    Attached Files:

    toby likes this.
  11. toby

    toby Member Licensed User

    Below is the unfiltered log with the new firebaseAuth.jar:

     
  12. Erel

    Erel Administrator Staff Member Licensed User

    This line: ResultArrived Error: null
    means that it failed to authenticate with Google.

    Unfortunately it doesn't provide any other information. Worth trying with a different Google account.
     
    toby likes this.
  13. toby

    toby Member Licensed User

    Sometimes it returned Success, still SignedIn event wasn't raised.

    I used a few Google accounts during tests, and I didn't notice any difference.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    Something is misconfigured. Hard to say what exactly. Try to change the package name and create a new firebase project.
     
    toby likes this.
  15. toby

    toby Member Licensed User

    It finally works after following your advice! Thank you very much, Erel, for your time.

    To save time for those who run into similar situations, I list what I did below:
    At b4a
    1. Renamed the package name
    2. Generated the private sign key
    At firebase console
    3. Selected a different project (I didn't create a new firebase project because I have another existing one)
    4.Selected Authentication, selected sign in methods and selected google and saved the change.
    5. Added a new app and downloaded the new Google-servivces.json file to the b4a project folder.
    Back to b4a
    6. Cleaned the project and ran the app.
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice