HttpsCallableReference

A reference to a callable HTTPS trigger in Cloud Functions, mirroring com.google.firebase.functions.HttpsCallableReference from the Firebase Android SDK. Obtained from FirebaseFunctions.getHttpsCallable or getHttpsCallableFromUrl.

The timeout is set with the setTimeout and withTimeout extensions taking a kotlin.time.Duration; the Android SDK's TimeUnit overloads are JVM-only and deprecated with an error in common code.

Not mirrored: stream() (returns an org.reactivestreams.Publisher, which is JVM-only, and the iOS SDK's streaming API is Swift-only).

A reference to a callable HTTPS trigger in Cloud Functions, mirroring com.google.firebase.functions.HttpsCallableReference from the Firebase Android SDK. Obtained from FirebaseFunctions.getHttpsCallable or getHttpsCallableFromUrl.

The timeout is set with the setTimeout and withTimeout extensions taking a kotlin.time.Duration; the Android SDK's TimeUnit overloads are JVM-only and deprecated with an error in common code.

Not mirrored: stream() (returns an org.reactivestreams.Publisher, which is JVM-only, and the iOS SDK's streaming API is Swift-only).

The JS SDK fixes a callable's options, including its timeout, when the callable is created, so the reference keeps what it needs to create one and js is created on demand with the current timeout.

The JS SDK fixes a callable's options, including its timeout, when the callable is created, so the reference keeps what it needs to create one and js is created on demand with the current timeout.

Properties

Link copied to clipboard
val ios: FIRHTTPSCallable

The underlying Firebase iOS SDK object; withTimeout creates a new one, so it is kept per reference.

Link copied to clipboard

The underlying Firebase JS SDK callable, created with the current timeout.

The underlying Firebase JS SDK callable, created with the current timeout.

Link copied to clipboard
actual val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

actual val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

expect val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

actual val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

actual val timeout: Long

The timeout of the calls made through this reference, in milliseconds.

Functions

Link copied to clipboard

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

actual fun call(data: Any?): Task<HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

actual fun call(data: Any?): Task<HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

expect fun call(data: Any?): Task<HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

actual fun call(data: Any?): Task<HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

Executes this callable HTTPS trigger without arguments. The request automatically carries the Firebase installation id and, when a user is signed in, their auth token. A failed task carries a FirebaseFunctionsException.

actual fun call(data: Any?): Task<HttpsCallableResult>

Executes this callable HTTPS trigger with data, which is serialized as JSON: null, a String, a number, a Boolean, a List or a Map with String keys of these (on JS also the JS SDK's own objects and arrays). See call.

Link copied to clipboard

Executes this callable HTTPS trigger without arguments and suspends until the result arrives; see invoke.

inline suspend operator fun <T> HttpsCallableReference.invoke(data: T, buildSettings: EncodeSettings.Builder.() -> Unit = {}): HttpsCallableResult

Executes this callable HTTPS trigger with data, serialized with kotlinx.serialization, and suspends until the result arrives. A failed call throws a FirebaseFunctionsException. See CompatHttpsCallableReference.call.

inline suspend operator fun <T> HttpsCallableReference.invoke(strategy: SerializationStrategy<T>, data: T, buildSettings: EncodeSettings.Builder.() -> Unit = {}): HttpsCallableResult

Executes this callable HTTPS trigger with data serialized by strategy; see invoke.

Link copied to clipboard
actual fun setTimeout(timeout: Long, units: Any)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

actual fun setTimeout(timeout: Long, units: Any)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

expect fun setTimeout(timeout: Long, units: Any)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

actual fun setTimeout(timeout: Long, units: Any)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

actual fun setTimeout(timeout: Long, units: Any)

Sets the timeout of the calls made through this reference; Android/JVM only, common code uses setTimeout with a Duration.

Link copied to clipboard

Sets the timeout of the calls made through this reference.

Sets the timeout of the calls made through this reference.

Sets the timeout of the calls made through this reference.

Sets the timeout of the calls made through this reference.

Sets the timeout of the calls made through this reference.

Link copied to clipboard
fun stream(): Publisher<StreamResponse>
fun stream(data: Any?): Publisher<StreamResponse>

Not in the common API (org.reactivestreams is JVM-only); the shipped streamAsFlow extension binds to it.

Link copied to clipboard

Calls the function with data and streams its response: a StreamResponse.Message for every chunk the function sends while it runs, then a StreamResponse.Result with its return value, after which the flow completes. A failed call fails the flow with a FirebaseFunctionsException.

Fails: the iOS SDK's streaming API (Callable.stream) is Swift-only, which Kotlin/Native cannot call.

expect fun HttpsCallableReference.streamAsFlow(data: Any? = null): Flow<StreamResponse>

Calls the function with data and streams its response: a StreamResponse.Message for every chunk the function sends while it runs, then a StreamResponse.Result with its return value, after which the flow completes. A failed call fails the flow with a FirebaseFunctionsException.

Over the JS SDK's callable.stream(data): its async iterable of chunks, then its data promise.

Over the JS SDK's callable.stream(data): its async iterable of chunks, then its data promise.

Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
Link copied to clipboard
actual fun withTimeout(timeout: Long, units: Any): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

actual fun withTimeout(timeout: Long, units: Any): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

expect fun withTimeout(timeout: Long, units: Any): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

actual fun withTimeout(timeout: Long, units: Any): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

actual fun withTimeout(timeout: Long, units: Any): HttpsCallableReference

A copy of this reference with the given timeout; Android/JVM only, common code uses withTimeout with a Duration.

Link copied to clipboard

A copy of this reference whose calls use the given timeout.

A copy of this reference whose calls use the given timeout.

A copy of this reference whose calls use the given timeout.

A copy of this reference whose calls use the given timeout.

A copy of this reference whose calls use the given timeout.