:library:integration:firebase
Purpose
Implements the toolkit's Firebase analytics/crash-reporting contract and provides Firebase messaging service wiring.
Owns
data.repositories.FirebaseTelemetryRepositoryfor analytics events, breadcrumbs, and crash reporting.firebaseModuleKoin bindings.data.notifications.FirebaseNotificationsServiceand its notification/wake-lock manifest permissions.
Does not own
The SDK-neutral
TelemetryRepositorycontract, owned by:library:core:common.User consent decisions and persisted diagnostics preferences, owned by consent/settings/DataStore modules.
Depends on
:library:core:commonfor theTelemetryRepositorycontract and shared analytics values.
Firebase Analytics, Crashlytics, Performance, and Messaging materially define this module.
Used by
:sampleand:library:apptoolkitto install the production Firebase implementation.
Flow chart
flowchart TD
Features[Features and LoggedScreenViewModel] --> Contract[TelemetryRepository]
Consent[Diagnostics and consent state] --> Contract
Contract -->|Koin binding| Impl[FirebaseTelemetryRepository]
Impl --> Analytics[Firebase Analytics]
Impl --> Crash[Crashlytics breadcrumbs and non-fatals]
Impl --> Performance[Firebase Performance enablement]
FCM[Firebase Cloud Messaging] --> Service[FirebaseNotificationsService]
Service --> Notification[Android notification]
Manifest[Permissions and service declaration] --> ServiceArchitectural decisions
Features depend on the SDK-neutral contracts in
core.common.telemetry; only this module imports concrete Firebase products.FirebaseTelemetryRepositoryimplements all of them as oneTelemetryRepository, bound once, andtelemetryModulehands the same instance out asAnalyticsReporter,DiagnosticsReporterandTelemetryCollection, so Firebase is set up once.Consent updates reach the SDKs through
TelemetryCollection, applied by the consent owners only, so enablement policy does not leak into every feature.This module is the deliberate exception to the rule that
data/code reports no analytics: it is the transport that sends them.checkModuleBoundariesnames it as such.Messaging remains a framework-created service and is wired through the manifest rather than the Koin-created repository lifecycle.
Public contracts
firebaseModuleand the Android messaging service declared in the manifest.
Internal implementations
Firebase SDK calls and notification handling.
Current risks
The module bundles several Firebase products, so hosts cannot currently select analytics, crash reporting, performance, and messaging independently at the module boundary.