firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Functions GetHttpsCallable not working on iOS or Android

Open robertmaxted opened this issue 10 months ago • 2 comments

Description

Hi Guys,

I am currently using this package https://github.com/TobiasBuchholz/Plugin.Firebase which is a wrapper around this (and the android equivalent). The cloud functions worked perfectly before when using HttpClient and creating my functions as .https.onRequest etc. The reason I am trying to migrate my functions over from using HttpClient etc, to using the callable functions is so that I do not have to handle all of the authentication tokens etc..

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

Reproducing the issue

this is using a .net maui application.. I am not sure if this is testable with ease for you guys, however I believe the same issue may happen in native (swift)..?

Firebase SDK Version

10.9

Xcode Version

15.3

Installation Method

N/A

Firebase Product(s)

Authentication, Crashlytics, Firestore, Functions

Targeted Platforms

iOS

Relevant Log Output

N/A

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

robertmaxted avatar Apr 30 '24 20:04 robertmaxted