Skip to content

A demo of firebase-kotlin-sdk with Compose multiplatform and KotlinJS

License

Notifications You must be signed in to change notification settings

frankois944/FirebaseKmpDemo

Repository files navigation

Setup Firebase for Compose multiplatform Android, iOS, desktop and web (almost).

This repository is a sample showing how to load Firebase and use some features on a Compose multiplaform Application.

Based on the project Firebase for Kotlin.

It's implementing and loading all modules created by this project, except crashlytics (use CrashKiOS instead).

I'm using spm4kmp for compiling Firebase iOS

Setup

Each targeted platform has its own way to set up

iOS

For starting up the SDK, the iOS app is following the official way and the CocoaPods integration.

Some Swift code needs to be written to set up the environment.

An iOS Firebase app needs to be created and added to the iOS project as recommended.

Android

For starting up the SDK, the Android app is following the official way and the Gradle integration.

No code needs to be written, as the Gradle plugin does the job.

An Android Firebase app needs to be created and added to the Android project as recommended.

Desktop

To start up the SDK, the desktop app needs to be manually loaded.

Some Kotlin code needs to be written.

An Android Firebase app needs to be created; even if it's not one, it's still compatible; maybe a Firebase web app configuration should also do the job.

Web with KotlinJS

To start up the SDK, the WebApp app needs to be manually loaded.

Some Kotlin code needs to be written.

The firebase needs to be added as a npm dependency, currently implementation(npm("firebase", "10.12.2")), or a ealier version.

Warning

firebase-kotlin-sdk for JS is out of date, some kotlin methods won't work as the JS API changed

I recommend to complete the missing method yourself.