Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1008 Bytes

File metadata and controls

29 lines (21 loc) · 1008 Bytes

Module kotlinx-coroutines-play-services

Integration with Google Play Services Tasks API.

Extension functions:

Name Description
Task.await Awaits for completion of the Task (cancellable)
Deferred.asTask Converts a deferred value to a Task

Example

Using Firebase APIs becomes simple:

FirebaseAuth.getInstance().signInAnonymously().await()
val snapshot = try {
    FirebaseFirestore.getInstance().document("users/$id").get().await() // Cancellable await
} catch (e: FirebaseFirestoreException) {
    // Handle exception
    return@async
}

// Do stuff