FirebaseAnalytics

Real code over the platform SDK through native; see the common declaration.

The entry point of Firebase Analytics, mirroring com.google.firebase.analytics.FirebaseAnalytics; obtained with com.google.firebase.Firebase.analytics.

On Android this class is a header stub for the real one (its bytecode is deleted after compilation); on the other platforms it is real code over the platform SDK through an internal NativeAnalytics. On the JVM it is a no-op, as firebase-java-sdk has no analytics. The JS SDK has no session timeout, session ID or analytics data reset (sessions are managed by gtag): on JS and wasmJs setSessionTimeoutDuration and resetAnalyticsData do nothing, getSessionId completes with null, and the three carry @dev.gitlive.firebase.UnsupportedOnJs, so code compiled for JS gets a warning until it opts in.

The Event, Param and UserProperty names are compile-time constants in the Android SDK (static finals); here they are vals with the same values, as an expect declaration cannot be const. Compare, match and concatenate them as usual, but off Android they cannot initialize a const val or be an annotation argument.

Real code over the platform SDK through native; see the common declaration.

Real code over the platform SDK through native; see the common declaration.

Real code over the platform SDK through native; see the common declaration.

Types

Link copied to clipboard
actual object Companion
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion
Link copied to clipboard
actual open class Event

The recommended event names.

actual open class Event

The recommended event names.

expect open class Event

The recommended event names.

actual open class Event

The recommended event names.

actual open class Event

The recommended event names.

actual open class Event

The recommended event names.

Link copied to clipboard
actual open class Param

The recommended parameter names.

actual open class Param

The recommended parameter names.

expect open class Param

The recommended parameter names.

actual open class Param

The recommended parameter names.

actual open class Param

The recommended parameter names.

actual open class Param

The recommended parameter names.

Link copied to clipboard
actual open class UserProperty

The recommended user property names.

actual open class UserProperty

The recommended user property names.

expect open class UserProperty

The recommended user property names.

actual open class UserProperty

The recommended user property names.

actual open class UserProperty

The recommended user property names.

actual open class UserProperty

The recommended user property names.

Properties

Link copied to clipboard
val FirebaseAnalytics.ios: <Error class: unknown class>

The Firebase iOS SDK class this wraps (its API is static).

Link copied to clipboard

The Firebase JS SDK object this wraps.

The Firebase JS SDK object this wraps.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
actual fun getAppInstanceId(): <Error class: unknown class><String?>
actual fun getAppInstanceId(): <Error class: unknown class><String?>
expect fun getAppInstanceId(): <Error class: unknown class><String?>
actual fun getAppInstanceId(): <Error class: unknown class><String?>
actual fun getAppInstanceId(): <Error class: unknown class><String?>
actual fun getAppInstanceId(): <Error class: unknown class><String?>
Link copied to clipboard

The app instance ID when it is known synchronously (Android, Apple), else null.

Link copied to clipboard
actual fun getSessionId(): <Error class: unknown class><Long?>
actual fun getSessionId(): <Error class: unknown class><Long?>
expect fun getSessionId(): <Error class: unknown class><Long?>
actual fun getSessionId(): <Error class: unknown class><Long?>

Completes with null: the JS SDK has no session ID (sessions are managed by gtag).

actual fun getSessionId(): <Error class: unknown class><Long?>
actual fun getSessionId(): <Error class: unknown class><Long?>

Completes with null: the JS SDK has no session ID (sessions are managed by gtag).

Link copied to clipboard
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
open override fun hashCode(): Int
Link copied to clipboard
actual fun logEvent(name: String, params: Bundle?)
actual fun logEvent(name: String, params: Bundle?)
expect fun logEvent(name: String, params: Bundle?)

Logs name with params (see Event and Param for the recommended names).

actual fun logEvent(name: String, params: Bundle?)
actual fun logEvent(name: String, params: Bundle?)
actual fun logEvent(name: String, params: Bundle?)
Link copied to clipboard
inline fun FirebaseAnalytics.logEvent(name: String, block: ParametersBuilder.() -> Unit)

Logs name with the parameters set in block, e.g. logEvent(FirebaseAnalytics.Event.LOGIN) { param(FirebaseAnalytics.Param.METHOD, "email") }.

Link copied to clipboard
actual fun resetAnalyticsData()
actual fun resetAnalyticsData()
expect fun resetAnalyticsData()
actual fun resetAnalyticsData()

Does nothing: the JS SDK has no analytics data reset.

actual fun resetAnalyticsData()
actual fun resetAnalyticsData()

Does nothing: the JS SDK has no analytics data reset.

Link copied to clipboard
Link copied to clipboard

Sets the consent settings assigned in block, e.g. setConsent { adStorage = FirebaseAnalytics.ConsentStatus.GRANTED }.

Link copied to clipboard
actual fun setDefaultEventParameters(parameters: Bundle?)
actual fun setDefaultEventParameters(parameters: Bundle?)
expect fun setDefaultEventParameters(parameters: Bundle?)

Parameters added to every event; null clears them.

actual fun setDefaultEventParameters(parameters: Bundle?)
actual fun setDefaultEventParameters(parameters: Bundle?)
actual fun setDefaultEventParameters(parameters: Bundle?)
Link copied to clipboard
actual fun setSessionTimeoutDuration(milliseconds: Long)
actual fun setSessionTimeoutDuration(milliseconds: Long)

The session timeout in milliseconds.

expect fun setSessionTimeoutDuration(milliseconds: Long)

The session timeout in milliseconds.

actual fun setSessionTimeoutDuration(milliseconds: Long)

Does nothing: the JS SDK has no session timeout (sessions are managed by gtag).

actual fun setSessionTimeoutDuration(milliseconds: Long)

The session timeout in milliseconds.

actual fun setSessionTimeoutDuration(milliseconds: Long)

Does nothing: the JS SDK has no session timeout (sessions are managed by gtag).

Link copied to clipboard
actual fun setUserId(id: String?)
actual fun setUserId(id: String?)
expect fun setUserId(id: String?)
actual fun setUserId(id: String?)
actual fun setUserId(id: String?)
actual fun setUserId(id: String?)
Link copied to clipboard
actual fun setUserProperty(name: String, value: String?)
actual fun setUserProperty(name: String, value: String?)
expect fun setUserProperty(name: String, value: String?)

Sets the user property name to value; null removes it.

actual fun setUserProperty(name: String, value: String?)
actual fun setUserProperty(name: String, value: String?)
actual fun setUserProperty(name: String, value: String?)
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String