tree: a8c6632f48c3dceccf23e82e71ce1fd1c5bf8bd8 [path history] [tgz]
  1. README.md
  2. api/
  3. build.gradle
  4. package.list
  5. src/
  6. test/
integration/kotlinx-coroutines-play-services/README.md

Module kotlinx-coroutines-play-services

Integration with Google Play Services Tasks API.

Extension functions:

NameDescription
Task.awaitAwaits for completion of the Task (cancellable)
Deferred.asTaskConverts 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