iOS Question IOS Authenticacion Firebase Google Email return empty

jlerner

Member
Licensed User
Longtime User
HI!

when then event "Auth_SignedIn" (of FirebaseAnalytics object), arrive with FirebaseUser , all data from user return Except EMAIL, and return "empty"....
if i look in the FirebaseUser i see....
1615466378704.png



But when i a try to get , i receive: null......

this my code:
Dim jo As NativeObject = User
Log(jo.GetField("_providerData" ).GetField("_obj").GetField("_email"))


whats rongs???!!

thanks!!!!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
What is the output of User.Email?

You can use this code to get the provider data:
B4X:
Dim no As NativeObject = User
Dim ProviderData As List = no.GetField("providerData")
If ProviderData.IsInitialized Then
    For Each UserInfo As NativeObject In ProviderData
        If UserInfo.GetField("providerID").IsInitialized Then
            Dim Provider As String = UserInfo.GetField("providerID").AsString
            If UserInfo.GetField("email").IsInitialized Then
                Dim email As String = UserInfo.GetField("email").AsString
                Log("Provider email: " & email)
            End If
        End If
    Next
End If
 
Upvote 0

jlerner

Member
Licensed User
Longtime User
What is the output of User.Email?

You can use this code to get the provider data:
B4X:
Dim no As NativeObject = User
Dim ProviderData As List = no.GetField("providerData")
If ProviderData.IsInitialized Then
    For Each UserInfo As NativeObject In ProviderData
        If UserInfo.GetField("providerID").IsInitialized Then
            Dim Provider As String = UserInfo.GetField("providerID").AsString
            If UserInfo.GetField("email").IsInitialized Then
                Dim email As String = UserInfo.GetField("email").AsString
                Log("Provider email: " & email)
            End If
        End If
    Next
End If

Thanks!!!!! SOLUCIONATED!
 
Upvote 0
Top