I am sucessfully running local cloud function from postman with this url:
http://127.0.0.1:5001/spotnik-7de37/us-central1/getUsers
But on my app using:
val functions = Firebase.functions
functions.useEmulator("10.0.2.2", 5001)
functions.getHttpsCallable("http://127.0.0.1:5001/spotnik-7de37/us-central1/getUsers")
I get:
Failed com.google.firebase.functions.FirebaseFunctionsException: INTERNAL
2
Answers
Need to use HTTPS protocol and not HTTP. See https://firebase.google.com/docs/emulator-suite/connect_functions
Take a look at Call functions from your app. Just use the name of the function for the
getHttpsCallable()
call:In your case I might try the above example using:
httpsCallable('spotnik-7de37')
Or use this:
getHttpsCallableFromUrl("http://127.0.0.1:5001/spotnik-7de37/us-central1/getUsers")
Also ensure you are using the proper IP for your emulator:
functions.useEmulator("127.0.0.1", 5001);
Additionally, if you want to use the entire URL string for the call, you can use getHttpsCallableFromUrl.