Hien Nguyen
07/14/2022, 10:21 AMTrương Anh Ngoc
07/14/2022, 10:33 AMNSURLSessionConfiguration
into IosClientEngineConfig
but don’t know how to set.
I’m using ktor-client-iOS
1.6.7Aleksei Tirman [JB]
07/14/2022, 10:58 AMconfigureSession
method to mutate an NSURLSessionConfiguration
:
val client = HttpClient(Darwin) { // `Ios` for Ktor 1.6.7
engine {
configureSession { // this: NSURLSessionConfiguration
// mutate configuration here
}
}
}
Trương Anh Ngoc
07/14/2022, 4:05 PMNSURLSessionConfiguration
from native into HttpClient(Darwin)
Ex:
• On Swift code, I have a URLSessionConfiguration.default
& want to pass it to KMM
• On KMM code, how can we config for this case with HttpClient(Darwin)
val client = HttpClient(Darwin) {
config(this)
engine {
configureSession {
// How can I inject NSURLSessionConfiguration from native here
}
}
}
Aleksei Tirman [JB]
07/14/2022, 5:50 PMval config = NSURLSessionConfiguration.defaultSessionConfiguration()
val session = NSURLSession.sessionWithConfiguration(config)
val client = HttpClient(Darwin) {
engine {
usePreconfiguredSession(session)
}
}
Trương Anh Ngoc
07/15/2022, 12:56 AM2.1.0
version to update it.