com.google.firebase.database.ktx
Classes
ChildEvent |
This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
ChildEvent.Added |
This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
ChildEvent.Changed |
This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
ChildEvent.Moved |
This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
ChildEvent.Removed |
This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
Extension functions summary
FirebaseDatabase |
Firebase.database(app: FirebaseApp, url: String) Accessing this object for Kotlin apps has changed; see the migration guide. |
FirebaseDatabase |
Firebase.database(app: FirebaseApp) Accessing this object for Kotlin apps has changed; see the migration guide. |
FirebaseDatabase |
Accessing this object for Kotlin apps has changed; see the migration guide. |
inline T? |
<T : Any?> DataSnapshot. This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
inline T? |
<T : Any?> MutableData. This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
inline Flow<T?> |
This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
Extension properties summary
Flow<ChildEvent> |
This property is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
FirebaseDatabase |
Accessing this object for Kotlin apps has changed; see the migration guide. |
Flow<DataSnapshot> |
This property is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration. |
Extension functions
database
fun Firebase.database(app: FirebaseApp, url: String): FirebaseDatabase
Accessing this object for Kotlin apps has changed; see the migration guide.
Returns the FirebaseDatabase
instance of the given FirebaseApp
and url
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
database
fun Firebase.database(app: FirebaseApp): FirebaseDatabase
Accessing this object for Kotlin apps has changed; see the migration guide.
Returns the FirebaseDatabase
instance of the given FirebaseApp
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
database
fun Firebase.database(url: String): FirebaseDatabase
Accessing this object for Kotlin apps has changed; see the migration guide.
Returns the FirebaseDatabase
instance for the specified url
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
getValue
inline fun <T : Any?> DataSnapshot.getValue(): T?
Returns the content of the DataSnapshot converted to a POJO.
Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T
, and not ? extends T
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
getValue
inline fun <T : Any?> MutableData.getValue(): T?
Returns the content of the MutableData converted to a POJO.
Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T
, and not ? extends T
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
values
inline fun <T : Any> Query.values(): Flow<T?>
Starts listening to this query and emits its values converted to a POJO via a Flow
.
-
When the returned flow starts being collected, a
ValueEventListener
will be attached. -
When the flow completes, the listener will be removed.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
Extension properties
childEvents
val Query.childEvents: Flow<ChildEvent>
Starts listening to this query's child events and emits its values via a Flow
.
-
When the returned flow starts being collected, a
ChildEventListener
will be attached. -
When the flow completes, the listener will be removed.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
database
val Firebase.database: FirebaseDatabase
Accessing this object for Kotlin apps has changed; see the migration guide.
Returns the FirebaseDatabase
instance of the default FirebaseApp
.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.
snapshots
val Query.snapshots: Flow<DataSnapshot>
Starts listening to this query and emits its values via a Flow
.
-
When the returned flow starts being collected, a
ValueEventListener
will be attached. -
When the flow completes, the listener will be removed.
Important In July 2025, we stopped releasing KTX modules and removed the KTX libraries from the Firebase Android BoM (v34.0.0). If you use KTX APIs from the KTX modules, we recommend that you migrate your app to use KTX APIs from the main modules instead. For details, see the FAQ about this initiative.