FirebaseFunctions Framework Reference Stay organized with collections Save and categorize content based on your preferences.
Functions
@objc(FIRFunctions)openclassFunctions:NSObject,@uncheckedSendableFunctions is the client for Cloud Functions for a Firebase project.
The current emulator origin, or
nilif 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()->FunctionsReturn Value
A shared Functions instance initialized with the default
FirebaseApp.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)->FunctionsParameters
appThe app for the Firebase project.
Return Value
A shared Functions instance initialized with the specified
FirebaseApp.Creates a Cloud Functions client with the default app and given region.
Declaration
Swift
@objc(functionsForRegion:)openclassfuncfunctions(region:String)->FunctionsParameters
regionThe region for the HTTP trigger, such as
us-central1.Return Value
A shared Functions instance initialized with the default
FirebaseAppand 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)->FunctionsParameters
customDomainA custom domain for the HTTP trigger, such as“https://mydomain.com”.
Return Value
A shared Functions instance initialized with the default
FirebaseAppand 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)->FunctionsParameters
appThe app for the Firebase project.
regionThe region for the HTTP trigger, such as
us-central1.Return Value
An instance of
Functionswith 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)->FunctionsParameters
appThe app for the Firebase project.
customDomainA custom domain for the HTTP trigger, such as
https://mydomain.com.Return Value
An instance of
Functionswith 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)->HTTPSCallableParameters
nameThe 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)->HTTPSCallableParameters
nameThe name of the Callable HTTPS trigger.
optionsThe 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)->HTTPSCallableParameters
urlThe 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)->HTTPSCallableParameters
urlThe URL of the Callable HTTPS trigger.
optionsThe 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 an
Encodablerequest and the type of aDecodableresponse.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
nameThe name of the Callable HTTPS trigger
requestAsThe type of the
Encodableentity to use for requests to thisCallableresponseAsThe type of the
Decodableentity to use for responses from thisCallableencoderThe encoder instance to use to perform encoding.
decoderThe 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 an
Encodablerequest and the type of aDecodableresponse.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
nameThe name of the Callable HTTPS trigger
optionsThe options with which to customize the Callable HTTPS trigger.
requestAsThe type of the
Encodableentity to use for requests to thisCallableresponseAsThe type of the
Decodableentity to use for responses from thisCallableencoderThe encoder instance to use to perform encoding.
decoderThe 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 an
Encodablerequest and the type of aDecodableresponse.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
urlThe url of the Callable HTTPS trigger
requestAsThe type of the
Encodableentity to use for requests to thisCallableresponseAsThe type of the
Decodableentity to use for responses from thisCallableencoderThe encoder instance to use to perform encoding.
decoderThe 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 an
Encodablerequest and the type of aDecodableresponse.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
urlThe url of the Callable HTTPS trigger
optionsThe options with which to customize the Callable HTTPS trigger.
requestAsThe type of the
Encodableentity to use for requests to thisCallableresponseAsThe type of the
Decodableentity to use for responses from thisCallableencoderThe encoder instance to use to perform encoding.
decoderThe 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
hostThe host of the local emulator, such as “localhost”.
portThe 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.