Archie
03/22/2021, 10:53 AMIosClientEngine
inside iosMain
but I cant seem to find the build function Ios
? Ive added the dependency io.ktor:ktor-client-ios:1.5.2
. Is there anything I should do? Does anyone have an example of this. Please help. Thanks in advance.ptsiogas
03/22/2021, 3:44 PM@KtorExperimentalAPI
actual class HttpClientProvider {
actual fun getHttpClient(): HttpClient {
return HttpClient(Ios) {
engine {
//your stuff
}
}
}
}
in your build.gradle.kts you should have something similar to this example:
kotlin {
sourceSets {
val commonMain by getting {
dependencies {
//your stuff
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-serialization:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
}
}
val iosMain by getting {
dependencies {
//your stuff
implementation("io.ktor:ktor-client-ios:$ktorVersion")
}
}
}
}
I hope this helps you.Archie
03/25/2021, 6:29 AMkotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false