Start Koin on Android & iOS
Initialize the graph from each platform's entry point.
A Module Needs Starting
Declaring modules is only half the job. Each platform must start Koin at launch so the container is ready before anything asks for a dependency.
A Shared Init Helper
Put the common startup in shared code with a small initKoin function. Both platforms call it, so the wiring never drifts apart.
fun initKoin() = startKoin {
modules(appModule())
}All lessons in this course
- Declare a Shared Koin Module
- single vs factory Scopes
- Start Koin on Android & iOS
- Inject into ViewModels & Repos