Java Question Firebase Firestore Lib Not Found

Tin Ko Ko Latt

Member
Licensed User
I want to use Firebase Firestore Library. I see firestore lib post But i don't see any attachent. So if you have, show me please..
 

DonManfred

Expert
Licensed User
1. You are posting in the wrong Forum
2. The Library is discontinued. No download available anymore.
 

facho_28

New Member
Hi, I leave you an example that I did to create a document. You need to have a Firebase token.

Ejemplo Crear Documento:
Public Sub createDocument(Token As String, Coleccion As String, Documento As String, Campos As Map) As ResumableSub
    
    Dim url As String = $"https://firestore.googleapis.com/v1/projects/xxxxx/databases/(default)/documents/${Coleccion}?documentId=${Documento}"$
    Dim json As JSONGenerator
    json.Initialize(CreateMap("fields":Campos))
    
    Dim j As HttpJob : j.Initialize("",Me)
    Log(json.ToString)
    j.PostString(url,json.ToString)
    j.GetRequest.SetHeader("Authorization","Bearer " & Token)
    j.GetRequest.SetContentType("application/json")
    
    Wait For (j) JobDone(j As HttpJob)
    Return GenerateResult(j)

End Sub

Private Sub GenerateResult(j As HttpJob) As Map
    Dim response As String = ""
    If j.Success Then
        response = j.GetString
        Log(j.GetString)
    Else
        response = j.ErrorMessage
    End If
    
    Dim parser As JSONParser
    parser.Initialize(response)
    Dim tmp_result As Map = parser.NextObject
    tmp_result.Put("success",j.Success)
    
    j.Release
    Return tmp_result
End Sub

I hope it helps you
 
Top