I'm trying to call firebase functions from my flutter application for saving an image in firestore.
I am using the following code to upload my image data, But i'm receiving the error FormatException: Invalid envelope
_image = image.readAsBytes();
CloudFunctions.instance.call(
functionName: 'updateUserImg',
parameters: <String, dynamic>{
'img':_image,
},
);
My cloud function is not even getting called, seems like i'm sending the data in wrong format.
How I can fix this issue?
Thanks.
This happens when your request times out. Make sure you have an active internet connection. In case of using an emulator over LAN, make sure you specify origin as follows.
cloudFunctions.useFunctionsEmulator(
origin: "http://192.168.31.107:5001");
instead of
_cloudFunctions.useFunctionsEmulator(
origin: "192.168.31.107:5001");
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