tree: 2af5a5bea2bbf4cb910c871095417abb5e5d1f81 [path history] [tgz]
  1. src/
  2. test/
  3. build.gradle
  4. package.list
  5. README.md
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