Functions
@objc(FIRFunctions)
open class Functions : NSObject, @unchecked SendableFunctions is the client for Cloud Functions for a Firebase project.
-
The current emulator origin, or
nilif it is not set.Declaration
Swift
open var emulatorOrigin: String? { get } -
Creates a Cloud Functions client using the default or returns a pre-existing instance if it already exists.
Declaration
Swift
@objc(functions) open class func functions() -> FunctionsReturn Value
A shared Functions instance initialized with the default
FirebaseApp. -
Creates a Cloud Functions client with the given app, or returns a pre-existing instance if one already exists.
Declaration
Swift
@objc(functionsForApp:) open class func functions(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:) open class func functions(region: String) -> FunctionsParameters
regionThe region for the HTTP trigger, such as
us-central1.Return Value
A shared Functions instance initialized with the default
FirebaseAppand a custom 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:) open class func functions(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 a custom HTTP trigger domain. -
Creates a Cloud Functions client with the given app and region, or returns a pre-existing instance if one already exists.
Declaration
Swift
@objc(functionsForApp:region:) open class func functions(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 a pre-existing instance if one already exists.
Declaration
Swift
@objc(functionsForApp:customDomain:) open class func functions(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:) open func httpsCallable(_ 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 configuration options.
Declaration
Swift
@objc(HTTPSCallableWithName:options:) public func httpsCallable(_ 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:) open func httpsCallable(_ 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 configuration options.
Declaration
Swift
@objc(HTTPSCallableWithURL:options:) public func httpsCallable(_ 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
open func httpsCallable<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 Cloud Functions 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
open func httpsCallable<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 Cloud Functions 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
open func httpsCallable<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 Cloud Functions 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
open func httpsCallable<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 Cloud Functions invocations.
-
Changes this instance to point to a Cloud Functions emulator running locally. See https://firebase.google.com/docs/functions/local-emulator
Declaration
Swift
@objc open func useEmulator(withHost host: String, port: Int)Parameters
hostThe host of the local emulator, such as “localhost”.
portThe port of the local emulator, for example 5005.