Firebase Kotlin SDK

repository·master·Indexed 23 days ago

https://github.com/gitliveapp/firebase-kotlin-sdk

A Kotlin-first, multiplatform SDK for Firebase that enables the use of Firebase services in common source code for iOS, Android, Desktop, and Web. It replaces callbacks with suspending functions and Flows, utilizes kotlinx.serialization for data mapping, and provides a DSL for Firestore queries. The SDK includes modules for Analytics, Auth, Remote Config, Realtime Database, Firestore, Functions, Installations, Messaging, Performance, and Storage.

Tokens
4.8K
Snippets
8
Records
22
Agent score
83%

What's inside firebase-kotlin-sdk

  1. How asynchronous operations work with Suspending Functions and Flows

    master

    The SDK uses Kotlin-native asynchronous patterns instead of callbacks or listeners:

    Suspending Functions

    Asynchronous operations that return a single value (or no value) are represented as suspend functions. Unlike callback-based APIs, waiting for the result is implicit. If you do not want to wait for the result, you must launch a new coroutine.

    Flows

    Asynchronous streams of values are represented by Flow.

    • Cold Flows: A new listener is added every time a terminal operator is applied.
    • Lifecycle: The listener is automatically removed when the flow completes or is cancelled.
    • Back-pressure: Use the buffer operator to specify a buffer size and control back-pressure, or use the conflate operator if you only care about the latest value.