Android Question Can get UserID from GoogleAuth2 with a FirebaseAuth Library?

scsjc

Well-Known Member
Licensed User
Longtime User
i use Firebase Auth to get the user information, in a Sub Auth_SignedIn i get the information from firebase auth,
but can't get the UserID from the part "google - accounts.google.com"

B4X:
Sub auth_SignedIn (User As FirebaseUser)
    log(User.Uid)
    log(User.Email)
    log(User.PhotoUrl)
...

Result on B4A
1610812692331.png


I see on result the "elementData-1" get this information on zza,
can access to this data?
 

scsjc

Well-Known Member
Licensed User
Longtime User
Yes:
B4X:
Dim jo As JavaObject = User
Dim ProviderData As List = jo.RunMethod("getProviderData", Null)
For Each UserInfo As JavaObject In ProviderData
    Log(UserInfo.RunMethod("getEmail", Null))
    Log(UserInfo.RunMethod("getProviderId", Null))
    Log(UserInfo.RunMethod("getUid", Null))
Next
Thanks :)
 
Upvote 0
Top