com.google.firebase.analytics.ktx

Classes

ConsentBuilder

This class is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

ParametersBuilder

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

inline Unit

This function is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

inline Unit
FirebaseAnalytics.setConsent(crossinline block: ConsentBuilder.() -> Unit)

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

FirebaseAnalytics

Accessing this object for Kotlin apps has changed; see the migration guide.

Extension functions

logEvent

inline fun FirebaseAnalytics.logEvent(name: String, block: ParametersBuilder.() -> Unit): Unit

Fluent version of FirebaseAnalytics.logEvent.

Example use:

Firebase.analytics.logEvent("myEvent") {
param(Params.VALUE, 3.99)
param(Params.CURRENCY, "USD")
}

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-analytics-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.,

setConsent

inline fun FirebaseAnalytics.setConsent(crossinline block: ConsentBuilder.() -> Unit): Unit

Fluent version of FirebaseAnalytics.setConsent.

Example use:

Firebase.analytics.setConsent {
adStorage = ConsentStatus.GRANTED
analyticsStorage = ConsentStatus.GRANTED
}

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-analytics-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

analytics

val Firebase.analyticsFirebaseAnalytics

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseAnalytics 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-analytics-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.,