Google is committed to advancing racial equity for Black communities. See how.

FirebaseFunctions

public class FirebaseFunctions extends Object

FirebaseFunctions lets you call Cloud Functions for Firebase.

Public Method Summary

HttpsCallableReference
getHttpsCallable(String name)
Returns a reference to the Callable HTTPS trigger with the given name.
static FirebaseFunctions
getInstance(String regionOrCustomDomain)
Creates a Cloud Functions client with the default app and given region or custom domain.
static FirebaseFunctions
getInstance()
Creates a Cloud Functions client with the default app.
static FirebaseFunctions
getInstance(FirebaseApp app, String regionOrCustomDomain)
Creates a Cloud Functions client with the given app and region or custom domain.
static FirebaseFunctions
getInstance(FirebaseApp app)
Creates a Cloud Functions client with the given app.
void
useEmulator(String host, int port)
Modifies this FirebaseFunctions instance to communicate with the Cloud Functions emulator.
void
useFunctionsEmulator(String origin)
This method is deprecated. Use useEmulator(String, int) to connect to the emulator.

Inherited Method Summary

Public Methods

public HttpsCallableReference getHttpsCallable (String name)

Returns a reference to the Callable HTTPS trigger with the given name.

public static FirebaseFunctions getInstance (String regionOrCustomDomain)

Creates a Cloud Functions client with the default app and given region or custom domain.

Parameters
regionOrCustomDomain The regionOrCustomDomain for the HTTPS trigger, such as "us-central1" or "//mydomain.com".

public static FirebaseFunctions getInstance ()

Creates a Cloud Functions client with the default app.

public static FirebaseFunctions getInstance (FirebaseApp app, String regionOrCustomDomain)

Creates a Cloud Functions client with the given app and region or custom domain.

Parameters
app The app for the Firebase project.
regionOrCustomDomain The region or custom domain for the HTTPS trigger, such as "us-central1" or "//mydomain.com".

public static FirebaseFunctions getInstance (FirebaseApp app)

Creates a Cloud Functions client with the given app.

Parameters
app The app for the Firebase project.

public void useEmulator (String host, int port)

Modifies this FirebaseFunctions instance to communicate with the Cloud Functions emulator.

Note: Call this method before using the instance to do any functions operations.

Parameters
host the emulator host (for example, 10.0.2.2)
port the emulator port (for example, 5001)

public void useFunctionsEmulator (String origin)

This method is deprecated.
Use useEmulator(String, int) to connect to the emulator.