TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Functions GetHttpsCallable not working on iOS or Android

robertmaxted opened this issue · comments

commented

Hi Guys,

I am trying to migrate my functions over from using http client etc, to using the CrossFireBaseFunctions. However I am getting these errors:

On iOS:
{Foundation.NSErrorException: Error Domain=com.firebase.functions Code=5 "NOT FOUND" UserInfo={NSLocalizedDescription=NOT FOUND}
at Plugin.Firebase.Functions.Platforms.iOS.HttpsCallableWrapper.d__41[[System.Collections.Generic.List1[[Vanity.Models.Business, Vanity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()\n at...

On Android:
{Firebase.Functions.FirebaseFunctionsException: NOT_FOUND
at Plugin.Firebase.Functions.Platforms.Android.HttpsCallableWrapper.d__41[[System.Collections.Generic.List1[[Vanity.Models.Business, Vanity, Version=1.0.0.0, Culture=neutral, PublicKeyTok…}

The Call:

`var jsonData = JsonConvert.SerializeObject(data); // Convert data dictionary to JSON string

var functions = CrossFirebaseFunctions.Current;

var businesses = await functions.GetHttpsCallable("someFunction").CallAsync<List>(jsonData);`

It throws the error on the call.

I have checked that the function exists in firebase functions.

Firestore, auth etc all work as expected, it is just cloud functions. I have also checked that there aren't any restrictions on the API keys, they are all ok.. I am stumped. Any advice or time would be greatly appreciated.

Kind regards,
Rob

@TobiasBuchholz @AdamEssenmacher

I'm going to guess your functions are outside us-central1. The plugin doesn't support this OOTB but it would be a small PR.

commented

Ahh!! I see, thanks @AdamEssenmacher ! Yes They are in europe-west2.. Is there anything I can do to help with this?

If you're comfortable submitting a PR, that's probably going to be the quickest way it gets done. CrossFirebaseFunctions.CreateInstance just needs an overload to accept the region and the two platform implementations updated to implement.

commented

Thanks @AdamEssenmacher I have made the changes: #293

Should be set for the next release

commented

@AdamEssenmacher Thanks for approving etc. That's great news! When is the next release??

commented

@AdamEssenmacher Also, thanks for the clean-up and changes.

@TobiasBuchholz has the release keys... so whenever he gets around to it.

commented

@AdamEssenmacher Thanks for the info. @TobiasBuchholz Any idea roughly when you will be releasing next? Many thanks.

Hi @robertmaxted,
I've just released the new package versions Plugin.Firebase.Functions 2.0.3 and Plugin.Firebase 2.0.14 that contain your PR 🚀 Thanks for your contribution! :)

commented

Hi @robertmaxted,

I've just released the new package versions Plugin.Firebase.Functions 2.0.3 and Plugin.Firebase 2.0.14 that contain your PR 🚀 Thanks for your contribution! :)

@TobiasBuchholz Awesome! You Hero! Thanks for getting that done so fast Tobias 👍

Sure, no problem! I would say it was a nice team effort! :D

commented

Sure, no problem! I would say it was a nice team effort! :D

Yeah for sure! Thanks again also @AdamEssenmacher