Android Question Firebase database access

Matrix

Member
Licensed User
Hello,
I try to connect a Firebase databas and search a solution.

First I make a Google authentication with
auth.SignInWithGoogle - this is OK

for access to the Firebase database , I need the TokenID
this TokenID can I read with auth.GetuserTokenid(User,False)
- is this correct ?


What is the best way/function to access the database?
can I use download2 from library OkHttpUtils2 and use the TokenID from auth.GetuserTokenid()
for example


B4X:
Dim j As HttpJob
    j.Initialize("", Me)
    'full list of features available: person.addresses,person.age_ranges,person.biographies,person.birthdays,person.bragging_rights,person.cover_photos,person.email_addresses,person.events,person.genders,person.im_clients,person.interests,person.locales,person.memberships,person.metadata,person.names,person.nicknames,person.occupations,person.organizations,person.phone_numbers,person.photos,person.relations,person.relationship_interests,person.relationship_statuses,person.residences,person.skills,person.taglines,person.urls
    j.Download2("https://people.googleapis.com/v1/people/me", _
         Array As String("access_token", TokenID, "requestMask.includeField", "person.email_addresses,person.birthdays,person.names"))
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        ParsePersonData(j.GetString)
    Else
        oauth2.ResetToken
        ToastMessageShow("Online data not available.", True)
    End If
    j.Release

or is there still a better way?


Thank you
Timo
 

Matrix

Member
Licensed User
hello BillMeyer, thanks for the Info with the link, I'll take a look!
just for information - can I do that with the code above or is that fundamentally wrong?
Thank you
 
Upvote 0
Top