FirebaseFunctions Framework Reference

Functions

@objc(FIRFunctions)openclassFunctions:NSObject,@uncheckedSendable

Functions is the client for Cloud Functions for a Firebase project.

  • The current emulator origin, ornil if it is not set.

    Declaration

    Swift

    openvaremulatorOrigin:String?{get}
  • Creates a Cloud Functions client using the default or returns a pre-existing instance if italready exists.

    Declaration

    Swift

    @objc(functions)openclassfuncfunctions()->Functions

    Return Value

    A shared Functions instance initialized with the defaultFirebaseApp.

  • Creates a Cloud Functions client with the given app, or returns a pre-existinginstance if one already exists.

    Declaration

    Swift

    @objc(functionsForApp:)openclassfuncfunctions(app:FirebaseApp)->Functions

    Parameters

    app

    The app for the Firebase project.

    Return Value

    A shared Functions instance initialized with the specifiedFirebaseApp.

  • Creates a Cloud Functions client with the default app and given region.

    Declaration

    Swift

    @objc(functionsForRegion:)openclassfuncfunctions(region:String)->Functions

    Parameters

    region

    The region for the HTTP trigger, such asus-central1.

    Return Value

    A shared Functions instance initialized with the defaultFirebaseApp and acustom region.

  • Creates a Cloud Functions client with the given custom domain or returns a pre-existing instance if one already exists.

    Declaration

    Swift

    @objc(functionsForCustomDomain:)openclassfuncfunctions(customDomain:String)->Functions

    Parameters

    customDomain

    A custom domain for the HTTP trigger, such as“https://mydomain.com”.

    Return Value

    A shared Functions instance initialized with the defaultFirebaseApp and acustom HTTP trigger domain.

  • Creates a Cloud Functions client with the given app and region, or returns a pre-existinginstance if one already exists.

    Declaration

    Swift

    @objc(functionsForApp:region:)openclassfuncfunctions(app:FirebaseApp,region:String)->Functions

    Parameters

    app

    The app for the Firebase project.

    region

    The region for the HTTP trigger, such asus-central1.

    Return Value

    An instance ofFunctions with a custom app and region.

  • Creates a Cloud Functions client with the given app and custom domain, or returns apre-existinginstance if one already exists.

    Declaration

    Swift

    @objc(functionsForApp:customDomain:)openclassfuncfunctions(app:FirebaseApp,customDomain:String)->Functions

    Parameters

    app

    The app for the Firebase project.

    customDomain

    A custom domain for the HTTP trigger, such ashttps://mydomain.com.

    Return Value

    An instance ofFunctions with a custom app and HTTP trigger domain.

  • Creates a reference to the Callable HTTPS trigger with the given name.

    Declaration

    Swift

    @objc(HTTPSCallableWithName:)openfunchttpsCallable(_name:String)->HTTPSCallable

    Parameters

    name

    The name of the Callable HTTPS trigger.

    Return Value

    A reference to a Callable HTTPS trigger.

  • Creates a reference to the Callable HTTPS trigger with the given name and configurationoptions.

    Declaration

    Swift

    @objc(HTTPSCallableWithName:options:)publicfunchttpsCallable(_name:String,options:HTTPSCallableOptions)->HTTPSCallable

    Parameters

    name

    The name of the Callable HTTPS trigger.

    options

    The options with which to customize the Callable HTTPS trigger.

    Return Value

    A reference to a Callable HTTPS trigger.

  • Creates a reference to the Callable HTTPS trigger with the given name.

    Declaration

    Swift

    @objc(HTTPSCallableWithURL:)openfunchttpsCallable(_url:URL)->HTTPSCallable

    Parameters

    url

    The URL of the Callable HTTPS trigger.

    Return Value

    A reference to a Callable HTTPS trigger.

  • Creates a reference to the Callable HTTPS trigger with the given name and configurationoptions.

    Declaration

    Swift

    @objc(HTTPSCallableWithURL:options:)publicfunchttpsCallable(_url:URL,options:HTTPSCallableOptions)->HTTPSCallable

    Parameters

    url

    The URL of the Callable HTTPS trigger.

    options

    The options with which to customize the Callable HTTPS trigger.

    Return Value

    A reference to a Callable HTTPS trigger.

  • Creates a reference to the Callable HTTPS trigger with the given name, the type of anEncodablerequest and the type of aDecodable response.

    Declaration

    Swift

    openfunchttpsCallable<Request:Encodable,Response:Decodable>(_name:String,requestAs:Request.Type=Request.self,responseAs:Response.Type=Response.self,encoder:FirebaseDataEncoder=FirebaseDataEncoder(),decoder:FirebaseDataDecoder=FirebaseDataDecoder())->Callable<Request,Response>

    Parameters

    name

    The name of the Callable HTTPS trigger

    requestAs

    The type of theEncodable entity to use for requests to thisCallable

    responseAs

    The type of theDecodable entity to use for responses from thisCallable

    encoder

    The encoder instance to use to perform encoding.

    decoder

    The decoder instance to use to perform decoding.

    Return Value

    A reference to an HTTPS-callable Cloud Function that can be used to make CloudFunctions invocations.

  • Creates a reference to the Callable HTTPS trigger with the given name, the type of anEncodablerequest and the type of aDecodable response.

    Declaration

    Swift

    openfunchttpsCallable<Request:Encodable,Response:Decodable>(_name:String,options:HTTPSCallableOptions,requestAs:Request.Type=Request.self,responseAs:Response.Type=Response.self,encoder:FirebaseDataEncoder=FirebaseDataEncoder(),decoder:FirebaseDataDecoder=FirebaseDataDecoder())->Callable<Request,Response>

    Parameters

    name

    The name of the Callable HTTPS trigger

    options

    The options with which to customize the Callable HTTPS trigger.

    requestAs

    The type of theEncodable entity to use for requests to thisCallable

    responseAs

    The type of theDecodable entity to use for responses from thisCallable

    encoder

    The encoder instance to use to perform encoding.

    decoder

    The decoder instance to use to perform decoding.

    Return Value

    A reference to an HTTPS-callable Cloud Function that can be used to make CloudFunctions invocations.

  • Creates a reference to the Callable HTTPS trigger with the given name, the type of anEncodablerequest and the type of aDecodable response.

    Declaration

    Swift

    openfunchttpsCallable<Request:Encodable,Response:Decodable>(_url:URL,requestAs:Request.Type=Request.self,responseAs:Response.Type=Response.self,encoder:FirebaseDataEncoder=FirebaseDataEncoder(),decoder:FirebaseDataDecoder=FirebaseDataDecoder())->Callable<Request,Response>

    Parameters

    url

    The url of the Callable HTTPS trigger

    requestAs

    The type of theEncodable entity to use for requests to thisCallable

    responseAs

    The type of theDecodable entity to use for responses from thisCallable

    encoder

    The encoder instance to use to perform encoding.

    decoder

    The decoder instance to use to perform decoding.

    Return Value

    A reference to an HTTPS-callable Cloud Function that can be used to make CloudFunctions invocations.

  • Creates a reference to the Callable HTTPS trigger with the given name, the type of anEncodablerequest and the type of aDecodable response.

    Declaration

    Swift

    openfunchttpsCallable<Request:Encodable,Response:Decodable>(_url:URL,options:HTTPSCallableOptions,requestAs:Request.Type=Request.self,responseAs:Response.Type=Response.self,encoder:FirebaseDataEncoder=FirebaseDataEncoder(),decoder:FirebaseDataDecoder=FirebaseDataDecoder())->Callable<Request,Response>

    Parameters

    url

    The url of the Callable HTTPS trigger

    options

    The options with which to customize the Callable HTTPS trigger.

    requestAs

    The type of theEncodable entity to use for requests to thisCallable

    responseAs

    The type of theDecodable entity to use for responses from thisCallable

    encoder

    The encoder instance to use to perform encoding.

    decoder

    The decoder instance to use to perform decoding.

    Return Value

    A reference to an HTTPS-callable Cloud Function that can be used to make CloudFunctions invocations.

  • Changes this instance to point to a Cloud Functions emulator running locally.Seehttps://firebase.google.com/docs/functions/local-emulator

    Declaration

    Swift

    @objcopenfuncuseEmulator(withHosthost:String,port:Int)

    Parameters

    host

    The host of the local emulator, such as “localhost”.

    port

    The port of the local emulator, for example 5005.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-15 UTC.