Firebase

Single access point to all Firebase SDKs, mirroring com.google.firebase.Firebase from the Firebase Android SDK.

The com.google.firebase packages in this library mirror the Firebase Android SDK API (including Task return types) so that Android code compiles unchanged on every platform; the dev.gitlive.firebase packages offer the Kotlin-first (suspending) API built on top of them. On Android and the JVM these declarations are only compiled against and never shipped: the real Firebase Android SDK classes are used.

Properties

Link copied to clipboard

Returns the default FirebaseApp instance.

Link copied to clipboard

Functions

Link copied to clipboard

Returns the FirebaseApp instance with the given name.

Link copied to clipboard
actual fun Firebase.fromResource(context: Any?): FirebaseOptions?
actual fun Firebase.fromResource(context: Any?): FirebaseOptions?

The options from GoogleService-Info.plist, or null when the bundle has none; the context is ignored.

expect fun Firebase.fromResource(context: Any? = null): FirebaseOptions?

The default FirebaseOptions of the platform's configuration, mirroring FirebaseOptions.fromResource(Context) from the Firebase Android SDK as a top-level function with the Context widened to Any? so that common code can call it. On Android they come from the resources generated by the Google Services Gradle plugin from google-services.json, on Apple platforms from GoogleService-Info.plist (the context is ignored); JS has no default configuration and returns null, as Android does when the resources are missing.

actual fun Firebase.fromResource(context: Any?): FirebaseOptions?

Always null: JS has no default configuration to read options from.

actual fun Firebase.fromResource(context: Any?): FirebaseOptions?
Link copied to clipboard
actual fun Firebase.getApps(context: Any?): List<FirebaseApp>
actual fun Firebase.getApps(context: Any?): List<FirebaseApp>

All initialized apps; the context is ignored.

expect fun Firebase.getApps(context: Any? = null): List<FirebaseApp>

The initialized apps, mirroring FirebaseApp.getApps(Context) from the Firebase Android SDK as a top-level function with the Context widened to Any? so that common code can call it (the static member itself cannot be given an Any? overload). On Android context must be an android.content.Context; on Apple platforms and JS it is ignored.

actual fun Firebase.getApps(context: Any?): List<FirebaseApp>

All initialized apps; the context is ignored.

actual fun Firebase.getApps(context: Any?): List<FirebaseApp>
Link copied to clipboard
actual fun Firebase.initialize(context: Any?): FirebaseApp?
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions): FirebaseApp
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: String): FirebaseApp
actual fun Firebase.initialize(context: Any?): FirebaseApp?

Configures the default app from GoogleService-Info.plist; the context is ignored.

actual fun Firebase.initialize(context: Any?, options: FirebaseOptions): FirebaseApp

Configures the default app with the given options; the context is ignored.

actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: String): FirebaseApp

Configures the app named name with the given options; the context is ignored.

expect fun Firebase.initialize(context: Any? = null): FirebaseApp?

Initializes the default FirebaseApp, mirroring Firebase.initialize(Context) from the Firebase Android SDK with the Context widened to Any? so that common code can pass the platform context through.

expect fun Firebase.initialize(context: Any? = null, options: FirebaseOptions): FirebaseApp

Initializes the default FirebaseApp with options; see initialize.

expect fun Firebase.initialize(context: Any? = null, options: FirebaseOptions, name: String): FirebaseApp

Initializes the FirebaseApp called name with options; see initialize.

actual fun Firebase.initialize(context: Any?): FirebaseApp?

Not supported on JS, where the options cannot be read from a default configuration: always throws.

actual fun Firebase.initialize(context: Any?, options: FirebaseOptions): FirebaseApp

Initializes the default app with the given options; the context is ignored.

actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: String): FirebaseApp

Initializes the app named name with the given options; the context is ignored.

actual fun Firebase.initialize(context: Any?): FirebaseApp?
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions): FirebaseApp
actual fun Firebase.initialize(context: Any?, options: FirebaseOptions, name: String): FirebaseApp