firebase-common provides multiplatform wrappers for Firebase app lifecycle and configuration (Firebase, FirebaseApp, FirebaseOptions).
- This module is considered complete only when Firebase Core app/bootstrap API surface is near parity across Android/Apple/JVM.
- JVM Admin initialization and option mapping must remain compatible with growth in downstream modules (
message,storage, future products). - Public API coverage target for this module is 100% within Firebase Core scope, with explicit caveats only when official parity is impossible.
- Update README coverage status whenever
firebase-commonpublic API expands. - Update
docs/public-api/firebase-common.mdin the same change.
firebase-common/src/commonMain/kotlin/com/biggates/firebase/common/Firebase.ktfirebase-common/src/androidMain/kotlin/com/biggates/firebase/common/Firebase.android.ktfirebase-common/src/appleMain/kotlin/com/biggates/firebase/common/Firebase.apple.ktfirebase-common/src/jvmMain/kotlin/com/biggates/firebase/common/Firebase.jvm.ktfirebase-common/build.gradle.ktsdocs/public-api/firebase-common.md
This module should only contain Firebase Core/bootstrap abstractions:
- App instance access.
- App initialization.
- App listing/deletion.
- Shared options model and platform mapping.
Do not add service-specific APIs here (Messaging/Auth/Firestore/etc.).
- Edit shared API first in
commonMain. - Implement matching
actualbehavior for Android, Apple, and JVM in the same PR. - If you add fields to
FirebaseOptions, update:
- Android
toAndroid()mapping. - Apple
toIos()mapping. - JVM app-state handling if needed.
- Any KDoc describing option semantics.
PlatformContextisandroid.app.Application; keep it that way unless architecture changes repo-wide.- Use Firebase Android SDK types only inside
androidMain. - Keep async bridge logic coroutine-friendly.
- Preserve current semantics of
delete()(boolean success signal).
PlatformContextis a placeholder type; do not assume app-level context exists.- Use CocoaPods
FirebaseCoreinterop in Apple source sets. - Avoid adding new force unwraps (
!!) for optional CocoaPods values; prefer defensive handling. - When Apple platforms lack a direct equivalent to Android behavior, document fallback behavior in KDoc.
- Keep JVM implementation deterministic and explicit; do not imply unsupported Firebase client behavior works on JVM.
initializeApp(context)should not auto-discover config on JVM; require explicit options-based initialization.- Maintain app registry behavior (
initializeApp,app,getApps,delete) for testability and API consistency. - Initialize Firebase Admin SDK in JVM path during
initializeApp(context, options). - Keep JVM-only options (
serviceAccountPath) documented and backward compatible.
- Keep public names stable (
Firebase,FirebaseApp,FirebaseOptions,initializeApp,getApps). - If behavior changes, note migration impact in PR and docs.
- Favor explicit, deterministic behavior over implicit side effects.
./gradlew :firebase-common:check./gradlew :firebase-common:assemble./gradlew :firebase-common:compileKotlinJvm./gradlew :firebase-common:publishToMavenLocal(optional pre-release validation)