Firebase helps mobile and web app teams succeed according to their site. The Firebase4Delphi library was created by Embarcadero MVP Daniele Spinetti and is a powerful solution for accessing Firebase from within Delphi.
Firebase “gives you functionality like analytics, databases, messaging and crash reporting so you can move quickly and focus on your users. It is built on Google infrastructure and scales automatically, for even the largest apps. Firebase products work great individually but share data and insights, so they work even better together.”
The next lines of source code shows a part of the Firebase database methods and functions in the Firebase4Delphi library:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
procedure TFirebaseDatabase.SetBaseURI(const ABaseURI: string); begin FBaseURI := ABaseURI; end; procedure TFirebaseDatabase.SetToken(const AToken: string); begin FToken := AToken; end; function TFirebaseDatabase.Get(const AParams: array of string; AQueryParams: TDictionary<string, string> = nil): IFirebaseResponse; var ARequest: IFirebaseRequest; begin ARequest := TFirebaseRequest.Create(BaseURI, Token); Result := ARequest.SendData(AParams, TFirebaseCommand.fcGet, nil, AQueryParams); end; function TFirebaseDatabase.Post(const AParams: array of string; AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil; ADataOwner: boolean = true): IFirebaseResponse; var ARequest: IFirebaseRequest; begin ARequest := TFirebaseRequest.Create(BaseURI, Token); Result := ARequest.SendData(AParams, TFirebaseCommand.fcPost, AData, AQueryParams, ADataOwner); end; function TFirebaseDatabase.Put(const AParams: array of string; AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil; ADataOwner: boolean = true): IFirebaseResponse; var ARequest: IFirebaseRequest; begin ARequest := TFirebaseRequest.Create(BaseURI, Token); Result := ARequest.SendData(AParams, TFirebaseCommand.fcPut, AData, AQueryParams, ADataOwner); end; function TFirebaseDatabase.Patch(const AParams: array of string; AData: TJSONValue = nil; AQueryParams: TDictionary<string, string> = nil; ADataOwner: boolean = true): IFirebaseResponse; var ARequest: IFirebaseRequest; begin ARequest := TFirebaseRequest.Create(BaseURI, Token); Result := ARequest.SendData(AParams, TFirebaseCommand.fcPatch, AData, AQueryParams, ADataOwner); end; function TFirebaseDatabase.Delete(const AParams: array of string; AQueryParams: TDictionary<string, string> = nil): IFirebaseResponse; var ARequest: IFirebaseRequest; begin ARequest := TFirebaseRequest.Create(BaseURI, Token); Result := ARequest.SendData(AParams, TFirebaseCommand.fcRemove, nil, AQueryParams); end; |
If you want to download this library, refer to the next link:
https://github.com/spinettaro/Firebase4Delphi
You can also check the official google website of Firebase. It’s full with tips, instructions, guides, videos, etc
An alternate Firebase library for Delphi called FB4D can be found in Embarcadero GetIt.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition