KMP first time using firebase-kotlin-sdk #716
mylockerbiz
started this conversation in
General
Replies: 1 comment
-
You'll need to decide for yourself how to deal with the context. For example, I have an // Common module
expect class AppContext {
fun getApplicationContext(): Any?
}
// Android module
actual class AppContext(val context: Application) {
actual fun getApplicationContext(): Any? = context
}
// iOS module
actual class AppContext {
actual fun getApplicationContext(): Any? = null
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i have a project with android, desktop and wasm. I am trying to implement firebase-kotlin-sdk.
the common code in App.kt fails when calling Firebase.initialize(Application(), options) because the context requirement is missing or not yet available. Is there a sample project or example code that works for all the platforms that shows the Application/Context object comes from?
Beta Was this translation helpful? Give feedback.
All reactions