Skip to content

Commit

Permalink
added http client for ios
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Nov 9, 2023
1 parent 5f6d80e commit 54743ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
package dev.datlag.burningseries.module

import io.ktor.client.*
import io.ktor.client.engine.darwin.*
import org.kodein.di.DI
import org.kodein.di.bindSingleton

actual object PlatformModule {
actual val di: DI.Module
get() = TODO("Not yet implemented")

private const val NAME = "PlatformModuleIOS"

actual val di: DI.Module = DI.Module(NAME) {
bindSingleton {
HttpClient(Darwin) {
engine {
configureRequest {
setAllowsCellularAccess(true)
}
}
}
}
}

}
4 changes: 1 addition & 3 deletions app/shared/src/iosMain/kotlin/main.ios.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ fun MainViewController(): UIViewController {
}

val root = NavHostComponent(
componentContext = DefaultComponentContext(
lifecycle = lifecycleOwner.lifecycle
),
componentContext = DefaultComponentContext(lifecycleOwner.lifecycle),
di = di
)

Expand Down

0 comments on commit 54743ea

Please sign in to comment.