Ive switched my functions regions from the US default and I cannot find a way to call them in flutter?
Is there a method of setting the region on the CloudFunctions instance or when you make the function calls
Thanks for the help.
I have managed to get this to work
CloudFunctions(app: FirebaseApp.instance, region: "europe-west2").getHttpsCallable(functionName: functionName);
But I am no longer using the singleton.
Is this a bad solution?
I don't see what's bad about it. You're doing exactly what you have to do. Just retain the result of CloudFunctions(app: FirebaseApp.instance, region: "europe-west2") in your own singleton if you want to reuse it.
I think the official solution is to use instanceFor:
final result =
await FirebaseFunctions.instanceFor(region: 'europe-west1').httpsCallable('addRental').call(jsonEncode(data));
worked for me, instead of
final result =
await FirebaseFunctions.instance.httpsCallable('addRental').call(jsonEncode(data));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With