SchneiderInfosystems / FB4D

Open Source Library for connecting Firebase by Delphi VCL/FMX
https://www.schneider-infosys.ch/DelphiBlog/de/#FB4D
Apache License 2.0
175 stars 51 forks source link

When we call CallFunction pass as an optional parameter the region where the cloud function is created. #134

Closed macc2010 closed 2 years ago

macc2010 commented 2 years ago

Is your feature request related to a problem? Please describe. Yes, it is a problem because I cannot call a function created as this : exports.myFunction = functions.region("europe-west1").https.onCall(async (data, context) => {

Describe the solution you'd like When calling CallFunctionSynchronous, pass as last parameter the region, for example : Res := Config1.Functions.CallFunctionSynchronous( 'myFunction', Data, 'europe-west1' );

Additional context I have modified FB4D.Interfaces.pas and FB4D.Functions.pas to add the aRegion : string parameter :

sources modified.zip

The source should to work as usual with the region us-central1, but now you can set other region.

Thank you.

SchneiderInfosystems commented 2 years ago

Thank you for this valuable feature enhancement. I have so far run all functions on us-central1 servers and have not noticed this issue myself. I could use your code right away with a few cosmetic fixes. Great!

SchneiderInfosystems commented 2 years ago

I have reconsidered the proposed interface change. The region should not be given with every function call but once when instantiating. Accordingly, I have now added the region to the configuration interface.