FirebaseFunctions Framework Reference

HTTPSCallable

@objc(FIRHTTPSCallable)
open class HTTPSCallable : NSObject

A HTTPSCallable is a reference to a particular Callable HTTPS trigger in Cloud Functions.

  • The timeout to use when calling the function. Defaults to 70 seconds.

    Declaration

    Swift

    @objc
    open var timeoutInterval: TimeInterval
  • Executes this Callable HTTPS trigger asynchronously.

    The data passed into the trigger can be any of the following types:

    • nil or NSNull
    • String
    • NSNumber, or any Swift numeric type bridgeable to NSNumber
    • [Any], where the contained objects are also one of these types.
    • [String: Any] where the values are also one of these types.

    The request to the Cloud Functions backend made by this method automatically includes a Firebase Installations ID token to identify the app instance. If a user is logged in with Firebase Auth, an auth ID token for the user is also automatically included.

    Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information regarding the app instance. To stop this, see Messaging.deleteData(). It resumes with a new FCM Token the next time you call this method.

    Declaration

    Swift

    @objc(callWithObject:completion:)
    open func call(_ data: Any? = nil,
                   completion: @escaping (HTTPSCallableResult?,
                                          Error?) -> Void)

    Parameters

    data

    Parameters to pass to the trigger.

    completion

    The block to call when the HTTPS request has completed.

  • Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C.

    The request to the Cloud Functions backend made by this method automatically includes a Firebase Installations ID token to identify the app instance. If a user is logged in with Firebase Auth, an auth ID token for the user is also automatically included.

    Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information regarding the app instance. To stop this, see Messaging.deleteData(). It resumes with a new FCM Token the next time you call this method.

    Declaration

    Swift

    @objc(callWithCompletion:)
    public func __call(completion: @escaping (HTTPSCallableResult?,
                                              Error?) -> Void)

    Parameters

    completion

    The block to call when the HTTPS request has completed.

  • Executes this Callable HTTPS trigger asynchronously.

    The request to the Cloud Functions backend made by this method automatically includes a FCM token to identify the app instance. If a user is logged in with Firebase Auth, an auth ID token for the user is also automatically included.

    Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information regarding the app instance. To stop this, see Messaging.deleteData(). It resumes with a new FCM Token the next time you call this method.

    Throws

    An error if the Cloud Functions invocation failed.

    Declaration

    Swift

    @available(iOS 13, tvOS 13, macOS 10.15, watchOS 7, *)
    open func call(_ data: Any? = nil) async throws -> HTTPSCallableResult

    Parameters

    data

    Parameters to pass to the trigger.

    Return Value

    The result of the call.