3

I know I can start my firebase cloud functions locally by running below command.

firebase serve --only functions

But, is there any way I can point my android client app to the locally running functions when calling functions with android firebase SDK, so that I can test the real app before deploying the functions to firebase?

Lahiru Chandima
  • 22,324
  • 22
  • 103
  • 179

2 Answers2

2

If you're just using HTTPS endpoints

Yes, use your server added and url, if your on your local network, thats the IP address of your computer running the local server - note don't forget to include the port too, e.g:

192.168.0.100:5000/endpointName

With regards to database triggers and onCall() functions (rather than HTTPS) I don't think they would work - however I don't know for sure.

also deploying to firebase can be a time consuming process using:

firebase deploy

or sometimes even

firebase deploy --only functions

However the following example would only deploy one function that you can specify, which is significantly quicker in completing.

firebase deploy --only functions:endpointName

I Hope this helps!

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
SagarScript
  • 1,145
  • 11
  • 15
  • The question is asking about redirecting callable functions via the Firebase client SDK, which is not currently supported. What you're describing here is not realy relevant, unfortunately. – Doug Stevenson Aug 18 '18 at 14:09
2

Changing the endpoint of a callable function using the client SDK is not currently supported. The team is aware that developers would like to do this, but it never hurts to file a feature request to help the team gauge the amount of demand for this feature.

In the meantime, you have other ways of invoking your callable locally, but not through the client SDK.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441