Task

actual abstract class Task<TResult>(source)

Represents an asynchronous operation, mirroring the Play Services Tasks API so that code written against the Firebase Android SDK compiles unchanged on every platform.

On Android and the JVM this is the real Play Services class; on Apple, JS and wasmJs platforms a Kotlin implementation is provided. Listeners on the Kotlin implementation are invoked on the thread that completes the task.

The static-only Tasks helper class is intentionally not mirrored; use kotlinx.coroutines.tasks.await or a TaskCompletionSource instead.

expect abstract class Task<TResult>(source)

Represents an asynchronous operation, mirroring the Play Services Tasks API so that code written against the Firebase Android SDK compiles unchanged on every platform.

On Android and the JVM this is the real Play Services class; on Apple, JS and wasmJs platforms a Kotlin implementation is provided. Listeners on the Kotlin implementation are invoked on the thread that completes the task.

The static-only Tasks helper class is intentionally not mirrored; use kotlinx.coroutines.tasks.await or a TaskCompletionSource instead.

actual abstract class Task<TResult>(source)

Represents an asynchronous operation, mirroring the Play Services Tasks API so that code written against the Firebase Android SDK compiles unchanged on every platform.

On Android and the JVM this is the real Play Services class; on Apple, JS and wasmJs platforms a Kotlin implementation is provided. Listeners on the Kotlin implementation are invoked on the thread that completes the task.

The static-only Tasks helper class is intentionally not mirrored; use kotlinx.coroutines.tasks.await or a TaskCompletionSource instead.

Constructors

Link copied to clipboard
actual constructor()
expect constructor()
actual constructor()

Properties

Link copied to clipboard
actual abstract val exception: Exception?
expect abstract val exception: Exception?
actual abstract val exception: Exception?
Link copied to clipboard
actual abstract val isCanceled: Boolean
expect abstract val isCanceled: Boolean
actual abstract val isCanceled: Boolean
Link copied to clipboard
actual abstract val isComplete: Boolean
expect abstract val isComplete: Boolean
actual abstract val isComplete: Boolean
Link copied to clipboard
actual abstract val isSuccessful: Boolean
expect abstract val isSuccessful: Boolean
actual abstract val isSuccessful: Boolean
Link copied to clipboard
actual abstract val result: TResult
expect abstract val result: TResult
actual abstract val result: TResult

Functions

Link copied to clipboard
actual abstract fun addOnCanceledListener(listener: OnCanceledListener): Task<TResult>
expect abstract fun addOnCanceledListener(listener: OnCanceledListener): Task<TResult>
actual abstract fun addOnCanceledListener(listener: OnCanceledListener): Task<TResult>
Link copied to clipboard
actual abstract fun addOnCompleteListener(listener: OnCompleteListener<TResult>): Task<TResult>
expect abstract fun addOnCompleteListener(listener: OnCompleteListener<TResult>): Task<TResult>
actual abstract fun addOnCompleteListener(listener: OnCompleteListener<TResult>): Task<TResult>
Link copied to clipboard
actual abstract fun addOnFailureListener(listener: OnFailureListener): Task<TResult>
expect abstract fun addOnFailureListener(listener: OnFailureListener): Task<TResult>
actual abstract fun addOnFailureListener(listener: OnFailureListener): Task<TResult>
Link copied to clipboard
actual abstract fun addOnSuccessListener(listener: OnSuccessListener<TResult>): Task<TResult>
expect abstract fun addOnSuccessListener(listener: OnSuccessListener<TResult>): Task<TResult>
actual abstract fun addOnSuccessListener(listener: OnSuccessListener<TResult>): Task<TResult>
Link copied to clipboard
actual suspend fun <T> Task<T>.await(): T

Awaits the completion of the task without blocking a thread, returning its result or throwing its exception, mirroring kotlinx.coroutines.tasks.await from kotlinx-coroutines-play-services so that Android code keeps its import unchanged on every platform.

expect suspend fun <T> Task<T>.await(): T

Awaits the completion of the task without blocking a thread, returning its result or throwing its exception, mirroring kotlinx.coroutines.tasks.await from kotlinx-coroutines-play-services so that Android code keeps its import unchanged on every platform.

actual suspend fun <T> Task<T>.await(): T

Awaits the completion of the task without blocking a thread, returning its result or throwing its exception, mirroring kotlinx.coroutines.tasks.await from kotlinx-coroutines-play-services so that Android code keeps its import unchanged on every platform.

Link copied to clipboard