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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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
.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. 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.
Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx
are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.